aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pps/kapi.c
diff options
context:
space:
mode:
authorAlexander Gordeev <lasaine@lvk.cs.msu.su>2011-01-12 20:00:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:19 -0500
commit7f7cce74105adf714bdc9357da3b6f06e019958c (patch)
tree1fcb692726c5bf91280bcac5a65584eddcd93bf6 /drivers/pps/kapi.c
parent5e196d34a776420278e4117b4742cd9d3f2350ed (diff)
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 <lasaine@lvk.cs.msu.su> Acked-by: Rodolfo Giometti <giometti@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pps/kapi.c')
-rw-r--r--drivers/pps/kapi.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
index 98d4012ca595..e8847c118ea3 100644
--- a/drivers/pps/kapi.c
+++ b/drivers/pps/kapi.c
@@ -19,6 +19,7 @@
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21 21
22#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22 23
23#include <linux/kernel.h> 24#include <linux/kernel.h>
24#include <linux/module.h> 25#include <linux/module.h>
@@ -80,20 +81,20 @@ struct pps_device *pps_register_source(struct pps_source_info *info,
80 81
81 /* Sanity checks */ 82 /* Sanity checks */
82 if ((info->mode & default_params) != default_params) { 83 if ((info->mode & default_params) != default_params) {
83 printk(KERN_ERR "pps: %s: unsupported default parameters\n", 84 pr_err("%s: unsupported default parameters\n",
84 info->name); 85 info->name);
85 err = -EINVAL; 86 err = -EINVAL;
86 goto pps_register_source_exit; 87 goto pps_register_source_exit;
87 } 88 }
88 if ((info->mode & (PPS_ECHOASSERT | PPS_ECHOCLEAR)) != 0 && 89 if ((info->mode & (PPS_ECHOASSERT | PPS_ECHOCLEAR)) != 0 &&
89 info->echo == NULL) { 90 info->echo == NULL) {
90 printk(KERN_ERR "pps: %s: echo function is not defined\n", 91 pr_err("%s: echo function is not defined\n",
91 info->name); 92 info->name);
92 err = -EINVAL; 93 err = -EINVAL;
93 goto pps_register_source_exit; 94 goto pps_register_source_exit;
94 } 95 }
95 if ((info->mode & (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) == 0) { 96 if ((info->mode & (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) == 0) {
96 printk(KERN_ERR "pps: %s: unspecified time format\n", 97 pr_err("%s: unspecified time format\n",
97 info->name); 98 info->name);
98 err = -EINVAL; 99 err = -EINVAL;
99 goto pps_register_source_exit; 100 goto pps_register_source_exit;
@@ -138,7 +139,7 @@ struct pps_device *pps_register_source(struct pps_source_info *info,
138 if (id >= PPS_MAX_SOURCES) { 139 if (id >= PPS_MAX_SOURCES) {
139 spin_unlock_irq(&pps_idr_lock); 140 spin_unlock_irq(&pps_idr_lock);
140 141
141 printk(KERN_ERR "pps: %s: too many PPS sources in the system\n", 142 pr_err("%s: too many PPS sources in the system\n",
142 info->name); 143 info->name);
143 err = -EBUSY; 144 err = -EBUSY;
144 goto free_idr; 145 goto free_idr;
@@ -150,12 +151,12 @@ struct pps_device *pps_register_source(struct pps_source_info *info,
150 /* Create the char device */ 151 /* Create the char device */
151 err = pps_register_cdev(pps); 152 err = pps_register_cdev(pps);
152 if (err < 0) { 153 if (err < 0) {
153 printk(KERN_ERR "pps: %s: unable to create char device\n", 154 pr_err("%s: unable to create char device\n",
154 info->name); 155 info->name);
155 goto free_idr; 156 goto free_idr;
156 } 157 }
157 158
158 pr_info("new PPS source %s at ID %d\n", info->name, id); 159 dev_info(pps->dev, "new PPS source %s\n", info->name);
159 160
160 return pps; 161 return pps;
161 162
@@ -168,7 +169,7 @@ kfree_pps:
168 kfree(pps); 169 kfree(pps);
169 170
170pps_register_source_exit: 171pps_register_source_exit:
171 printk(KERN_ERR "pps: %s: unable to register source\n", info->name); 172 pr_err("%s: unable to register source\n", info->name);
172 173
173 return NULL; 174 return NULL;
174} 175}