aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorFjodor Schelichow <fjodor.schelichow@hotmail.com>2014-06-18 20:52:00 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-19 20:46:51 -0400
commitfdc9167a7853523647ed0b19d719256c56f1f685 (patch)
tree431a7d7bbf787fa82ff1f6ac99027d989c3ddd5d /drivers/w1
parentea022eac1e297bbf725c1e484726b4c8fb09dd80 (diff)
w1: use pr_* instead of printk
This patch replaces all calls to the "printk" function within the main "w1" directory by calls to the appropriate "pr_*" function thus addressing the following warning generated by the checkpatch script: WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Signed-off-by: Fjodor Schelichow <fjodor.schelichow@hotmail.com> Signed-off-by: Roman Sommer <romsom2@yahoo.de> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1.c10
-rw-r--r--drivers/w1/w1_family.c2
-rw-r--r--drivers/w1/w1_int.c9
-rw-r--r--drivers/w1/w1_log.h4
-rw-r--r--drivers/w1/w1_netlink.c3
5 files changed, 12 insertions, 16 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 5d7341520544..592f7edc671e 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -1162,28 +1162,26 @@ static int __init w1_init(void)
1162{ 1162{
1163 int retval; 1163 int retval;
1164 1164
1165 printk(KERN_INFO "Driver for 1-wire Dallas network protocol.\n"); 1165 pr_info("Driver for 1-wire Dallas network protocol.\n");
1166 1166
1167 w1_init_netlink(); 1167 w1_init_netlink();
1168 1168
1169 retval = bus_register(&w1_bus_type); 1169 retval = bus_register(&w1_bus_type);
1170 if (retval) { 1170 if (retval) {
1171 printk(KERN_ERR "Failed to register bus. err=%d.\n", retval); 1171 pr_err("Failed to register bus. err=%d.\n", retval);
1172 goto err_out_exit_init; 1172 goto err_out_exit_init;
1173 } 1173 }
1174 1174
1175 retval = driver_register(&w1_master_driver); 1175 retval = driver_register(&w1_master_driver);
1176 if (retval) { 1176 if (retval) {
1177 printk(KERN_ERR 1177 pr_err("Failed to register master driver. err=%d.\n",
1178 "Failed to register master driver. err=%d.\n",
1179 retval); 1178 retval);
1180 goto err_out_bus_unregister; 1179 goto err_out_bus_unregister;
1181 } 1180 }
1182 1181
1183 retval = driver_register(&w1_slave_driver); 1182 retval = driver_register(&w1_slave_driver);
1184 if (retval) { 1183 if (retval) {
1185 printk(KERN_ERR 1184 pr_err("Failed to register slave driver. err=%d.\n",
1186 "Failed to register slave driver. err=%d.\n",
1187 retval); 1185 retval);
1188 goto err_out_master_unregister; 1186 goto err_out_master_unregister;
1189 } 1187 }
diff --git a/drivers/w1/w1_family.c b/drivers/w1/w1_family.c
index 3651ec801f45..1dc3051f7d76 100644
--- a/drivers/w1/w1_family.c
+++ b/drivers/w1/w1_family.c
@@ -87,7 +87,7 @@ void w1_unregister_family(struct w1_family *fent)
87 w1_reconnect_slaves(fent, 0); 87 w1_reconnect_slaves(fent, 0);
88 88
89 while (atomic_read(&fent->refcnt)) { 89 while (atomic_read(&fent->refcnt)) {
90 printk(KERN_INFO "Waiting for family %u to become free: refcnt=%d.\n", 90 pr_info("Waiting for family %u to become free: refcnt=%d.\n",
91 fent->fid, atomic_read(&fent->refcnt)); 91 fent->fid, atomic_read(&fent->refcnt));
92 92
93 if (msleep_interruptible(1000)) 93 if (msleep_interruptible(1000))
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index dfb6644028c0..47249a30eae3 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -50,8 +50,7 @@ static struct w1_master *w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
50 */ 50 */
51 dev = kzalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL); 51 dev = kzalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL);
52 if (!dev) { 52 if (!dev) {
53 printk(KERN_ERR 53 pr_err("Failed to allocate %zd bytes for new w1 device.\n",
54 "Failed to allocate %zd bytes for new w1 device.\n",
55 sizeof(struct w1_master)); 54 sizeof(struct w1_master));
56 return NULL; 55 return NULL;
57 } 56 }
@@ -91,7 +90,7 @@ static struct w1_master *w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
91 90
92 err = device_register(&dev->dev); 91 err = device_register(&dev->dev);
93 if (err) { 92 if (err) {
94 printk(KERN_ERR "Failed to register master device. err=%d\n", err); 93 pr_err("Failed to register master device. err=%d\n", err);
95 memset(dev, 0, sizeof(struct w1_master)); 94 memset(dev, 0, sizeof(struct w1_master));
96 kfree(dev); 95 kfree(dev);
97 dev = NULL; 96 dev = NULL;
@@ -120,7 +119,7 @@ int w1_add_master_device(struct w1_bus_master *master)
120 if (!(master->touch_bit && master->reset_bus) && 119 if (!(master->touch_bit && master->reset_bus) &&
121 !(master->write_bit && master->read_bit) && 120 !(master->write_bit && master->read_bit) &&
122 !(master->write_byte && master->read_byte && master->reset_bus)) { 121 !(master->write_byte && master->read_byte && master->reset_bus)) {
123 printk(KERN_ERR "w1_add_master_device: invalid function set\n"); 122 pr_err("w1_add_master_device: invalid function set\n");
124 return(-EINVAL); 123 return(-EINVAL);
125 } 124 }
126 125
@@ -254,7 +253,7 @@ void w1_remove_master_device(struct w1_bus_master *bm)
254 } 253 }
255 254
256 if (!found) { 255 if (!found) {
257 printk(KERN_ERR "Device doesn't exist.\n"); 256 pr_err("Device doesn't exist.\n");
258 return; 257 return;
259 } 258 }
260 259
diff --git a/drivers/w1/w1_log.h b/drivers/w1/w1_log.h
index 9c7bd62e6bdc..f9eecff23b8d 100644
--- a/drivers/w1/w1_log.h
+++ b/drivers/w1/w1_log.h
@@ -29,8 +29,8 @@
29#else 29#else
30# define assert(expr) \ 30# define assert(expr) \
31 if(unlikely(!(expr))) { \ 31 if(unlikely(!(expr))) { \
32 printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ 32 pr_err("Assertion failed! %s,%s,%s,line=%d\n", \
33 #expr, __FILE__, __func__, __LINE__); \ 33 #expr, __FILE__, __func__, __LINE__); \
34 } 34 }
35#endif 35#endif
36 36
diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index 351a2978ba72..dd9656237274 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -680,8 +680,7 @@ static void w1_cn_callback(struct cn_msg *cn, struct netlink_skb_parms *nsp)
680 if (sl) 680 if (sl)
681 dev = sl->master; 681 dev = sl->master;
682 } else { 682 } else {
683 printk(KERN_NOTICE 683 pr_notice("%s: cn: %x.%x, wrong type: %u, len: %u.\n",
684 "%s: cn: %x.%x, wrong type: %u, len: %u.\n",
685 __func__, cn->id.idx, cn->id.val, 684 __func__, cn->id.idx, cn->id.val,
686 msg->type, msg->len); 685 msg->type, msg->len);
687 err = -EPROTO; 686 err = -EPROTO;