From 7f7cce74105adf714bdc9357da3b6f06e019958c Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Wed, 12 Jan 2011 17:00:52 -0800 Subject: pps: convert printk/pr_* to dev_* Since we now have direct pointers to struct pps_device everywhere it's easy to use dev_* functions to print messages instead of plain printks. Where dev_* cannot be used printks are converted to pr_*. Signed-off-by: Alexander Gordeev Acked-by: Rodolfo Giometti Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pps/kapi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'drivers/pps/kapi.c') diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c index 98d4012..e8847c1 100644 --- a/drivers/pps/kapi.c +++ b/drivers/pps/kapi.c @@ -19,6 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include #include @@ -80,20 +81,20 @@ struct pps_device *pps_register_source(struct pps_source_info *info, /* Sanity checks */ if ((info->mode & default_params) != default_params) { - printk(KERN_ERR "pps: %s: unsupported default parameters\n", + pr_err("%s: unsupported default parameters\n", info->name); err = -EINVAL; goto pps_register_source_exit; } if ((info->mode & (PPS_ECHOASSERT | PPS_ECHOCLEAR)) != 0 && info->echo == NULL) { - printk(KERN_ERR "pps: %s: echo function is not defined\n", + pr_err("%s: echo function is not defined\n", info->name); err = -EINVAL; goto pps_register_source_exit; } if ((info->mode & (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) == 0) { - printk(KERN_ERR "pps: %s: unspecified time format\n", + pr_err("%s: unspecified time format\n", info->name); err = -EINVAL; goto pps_register_source_exit; @@ -138,7 +139,7 @@ struct pps_device *pps_register_source(struct pps_source_info *info, if (id >= PPS_MAX_SOURCES) { spin_unlock_irq(&pps_idr_lock); - printk(KERN_ERR "pps: %s: too many PPS sources in the system\n", + pr_err("%s: too many PPS sources in the system\n", info->name); err = -EBUSY; goto free_idr; @@ -150,12 +151,12 @@ struct pps_device *pps_register_source(struct pps_source_info *info, /* Create the char device */ err = pps_register_cdev(pps); if (err < 0) { - printk(KERN_ERR "pps: %s: unable to create char device\n", + pr_err("%s: unable to create char device\n", info->name); goto free_idr; } - pr_info("new PPS source %s at ID %d\n", info->name, id); + dev_info(pps->dev, "new PPS source %s\n", info->name); return pps; @@ -168,7 +169,7 @@ kfree_pps: kfree(pps); pps_register_source_exit: - printk(KERN_ERR "pps: %s: unable to register source\n", info->name); + pr_err("%s: unable to register source\n", info->name); return NULL; } -- cgit v1.1