aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFjodor Schelichow <fjodor.schelichow@hotmail.com>2014-06-18 20:52:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-19 20:46:51 -0400
commit1fda5690906b20ce823964eaac32baa8d3a03f61 (patch)
treef321cdbd005d4b58ae3a13b5598d82062a3694b3
parentfdc9167a7853523647ed0b19d719256c56f1f685 (diff)
w1/masters: use pr_* instead of printk
This patch replaces all calls to the "printk" function within the "masters" subdirectory 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>
-rw-r--r--drivers/w1/masters/ds1wm.c2
-rw-r--r--drivers/w1/masters/ds2482.c2
-rw-r--r--drivers/w1/masters/ds2490.c50
3 files changed, 27 insertions, 27 deletions
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index 02df3b1381d2..e0b8a4bc73df 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -563,7 +563,7 @@ static struct platform_driver ds1wm_driver = {
563 563
564static int __init ds1wm_init(void) 564static int __init ds1wm_init(void)
565{ 565{
566 printk("DS1WM w1 busmaster driver - (c) 2004 Szabolcs Gyurko\n"); 566 pr_info("DS1WM w1 busmaster driver - (c) 2004 Szabolcs Gyurko\n");
567 return platform_driver_register(&ds1wm_driver); 567 return platform_driver_register(&ds1wm_driver);
568} 568}
569 569
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index e033491fe308..e76a9b39abb2 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -226,7 +226,7 @@ static int ds2482_wait_1wire_idle(struct ds2482_data *pdev)
226 } 226 }
227 227
228 if (retries >= DS2482_WAIT_IDLE_TIMEOUT) 228 if (retries >= DS2482_WAIT_IDLE_TIMEOUT)
229 printk(KERN_ERR "%s: timeout on channel %d\n", 229 pr_err("%s: timeout on channel %d\n",
230 __func__, pdev->channel); 230 __func__, pdev->channel);
231 231
232 return temp; 232 return temp;
diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index 7404ad3062b7..1de6df87bfa3 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -206,7 +206,7 @@ static int ds_send_control_cmd(struct ds_device *dev, u16 value, u16 index)
206 err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), 206 err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]),
207 CONTROL_CMD, VENDOR, value, index, NULL, 0, 1000); 207 CONTROL_CMD, VENDOR, value, index, NULL, 0, 1000);
208 if (err < 0) { 208 if (err < 0) {
209 printk(KERN_ERR "Failed to send command control message %x.%x: err=%d.\n", 209 pr_err("Failed to send command control message %x.%x: err=%d.\n",
210 value, index, err); 210 value, index, err);
211 return err; 211 return err;
212 } 212 }
@@ -221,7 +221,7 @@ static int ds_send_control_mode(struct ds_device *dev, u16 value, u16 index)
221 err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), 221 err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]),
222 MODE_CMD, VENDOR, value, index, NULL, 0, 1000); 222 MODE_CMD, VENDOR, value, index, NULL, 0, 1000);
223 if (err < 0) { 223 if (err < 0) {
224 printk(KERN_ERR "Failed to send mode control message %x.%x: err=%d.\n", 224 pr_err("Failed to send mode control message %x.%x: err=%d.\n",
225 value, index, err); 225 value, index, err);
226 return err; 226 return err;
227 } 227 }
@@ -236,7 +236,7 @@ static int ds_send_control(struct ds_device *dev, u16 value, u16 index)
236 err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), 236 err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]),
237 COMM_CMD, VENDOR, value, index, NULL, 0, 1000); 237 COMM_CMD, VENDOR, value, index, NULL, 0, 1000);
238 if (err < 0) { 238 if (err < 0) {
239 printk(KERN_ERR "Failed to send control message %x.%x: err=%d.\n", 239 pr_err("Failed to send control message %x.%x: err=%d.\n",
240 value, index, err); 240 value, index, err);
241 return err; 241 return err;
242 } 242 }
@@ -255,7 +255,8 @@ static int ds_recv_status_nodump(struct ds_device *dev, struct ds_status *st,
255 err = usb_interrupt_msg(dev->udev, usb_rcvintpipe(dev->udev, 255 err = usb_interrupt_msg(dev->udev, usb_rcvintpipe(dev->udev,
256 dev->ep[EP_STATUS]), buf, size, &count, 100); 256 dev->ep[EP_STATUS]), buf, size, &count, 100);
257 if (err < 0) { 257 if (err < 0) {
258 printk(KERN_ERR "Failed to read 1-wire data from 0x%x: err=%d.\n", dev->ep[EP_STATUS], err); 258 pr_err("Failed to read 1-wire data from 0x%x: err=%d.\n",
259 dev->ep[EP_STATUS], err);
259 return err; 260 return err;
260 } 261 }
261 262
@@ -267,17 +268,17 @@ static int ds_recv_status_nodump(struct ds_device *dev, struct ds_status *st,
267 268
268static inline void ds_print_msg(unsigned char *buf, unsigned char *str, int off) 269static inline void ds_print_msg(unsigned char *buf, unsigned char *str, int off)
269{ 270{
270 printk(KERN_INFO "%45s: %8x\n", str, buf[off]); 271 pr_info("%45s: %8x\n", str, buf[off]);
271} 272}
272 273
273static void ds_dump_status(struct ds_device *dev, unsigned char *buf, int count) 274static void ds_dump_status(struct ds_device *dev, unsigned char *buf, int count)
274{ 275{
275 int i; 276 int i;
276 277
277 printk(KERN_INFO "0x%x: count=%d, status: ", dev->ep[EP_STATUS], count); 278 pr_info("0x%x: count=%d, status: ", dev->ep[EP_STATUS], count);
278 for (i=0; i<count; ++i) 279 for (i=0; i<count; ++i)
279 printk("%02x ", buf[i]); 280 pr_info("%02x ", buf[i]);
280 printk(KERN_INFO "\n"); 281 pr_info("\n");
281 282
282 if (count >= 16) { 283 if (count >= 16) {
283 ds_print_msg(buf, "enable flag", 0); 284 ds_print_msg(buf, "enable flag", 0);
@@ -305,21 +306,21 @@ static void ds_dump_status(struct ds_device *dev, unsigned char *buf, int count)
305 } 306 }
306 ds_print_msg(buf, "Result Register Value: ", i); 307 ds_print_msg(buf, "Result Register Value: ", i);
307 if (buf[i] & RR_NRS) 308 if (buf[i] & RR_NRS)
308 printk(KERN_INFO "NRS: Reset no presence or ...\n"); 309 pr_info("NRS: Reset no presence or ...\n");
309 if (buf[i] & RR_SH) 310 if (buf[i] & RR_SH)
310 printk(KERN_INFO "SH: short on reset or set path\n"); 311 pr_info("SH: short on reset or set path\n");
311 if (buf[i] & RR_APP) 312 if (buf[i] & RR_APP)
312 printk(KERN_INFO "APP: alarming presence on reset\n"); 313 pr_info("APP: alarming presence on reset\n");
313 if (buf[i] & RR_VPP) 314 if (buf[i] & RR_VPP)
314 printk(KERN_INFO "VPP: 12V expected not seen\n"); 315 pr_info("VPP: 12V expected not seen\n");
315 if (buf[i] & RR_CMP) 316 if (buf[i] & RR_CMP)
316 printk(KERN_INFO "CMP: compare error\n"); 317 pr_info("CMP: compare error\n");
317 if (buf[i] & RR_CRC) 318 if (buf[i] & RR_CRC)
318 printk(KERN_INFO "CRC: CRC error detected\n"); 319 pr_info("CRC: CRC error detected\n");
319 if (buf[i] & RR_RDP) 320 if (buf[i] & RR_RDP)
320 printk(KERN_INFO "RDP: redirected page\n"); 321 pr_info("RDP: redirected page\n");
321 if (buf[i] & RR_EOS) 322 if (buf[i] & RR_EOS)
322 printk(KERN_INFO "EOS: end of search error\n"); 323 pr_info("EOS: end of search error\n");
323 } 324 }
324} 325}
325 326
@@ -330,15 +331,13 @@ static void ds_reset_device(struct ds_device *dev)
330 * the strong pullup. 331 * the strong pullup.
331 */ 332 */
332 if (ds_send_control_mode(dev, MOD_PULSE_EN, PULSE_SPUE)) 333 if (ds_send_control_mode(dev, MOD_PULSE_EN, PULSE_SPUE))
333 printk(KERN_ERR "ds_reset_device: " 334 pr_err("ds_reset_device: Error allowing strong pullup\n");
334 "Error allowing strong pullup\n");
335 /* Chip strong pullup time was cleared. */ 335 /* Chip strong pullup time was cleared. */
336 if (dev->spu_sleep) { 336 if (dev->spu_sleep) {
337 /* lower 4 bits are 0, see ds_set_pullup */ 337 /* lower 4 bits are 0, see ds_set_pullup */
338 u8 del = dev->spu_sleep>>4; 338 u8 del = dev->spu_sleep>>4;
339 if (ds_send_control(dev, COMM_SET_DURATION | COMM_IM, del)) 339 if (ds_send_control(dev, COMM_SET_DURATION | COMM_IM, del))
340 printk(KERN_ERR "ds_reset_device: " 340 pr_err("ds_reset_device: Error setting duration\n");
341 "Error setting duration\n");
342 } 341 }
343} 342}
344 343
@@ -363,7 +362,7 @@ static int ds_recv_data(struct ds_device *dev, unsigned char *buf, int size)
363 u8 buf[ST_SIZE]; 362 u8 buf[ST_SIZE];
364 int count; 363 int count;
365 364
366 printk(KERN_INFO "Clearing ep0x%x.\n", dev->ep[EP_DATA_IN]); 365 pr_info("Clearing ep0x%x.\n", dev->ep[EP_DATA_IN]);
367 usb_clear_halt(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_DATA_IN])); 366 usb_clear_halt(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_DATA_IN]));
368 367
369 count = ds_recv_status_nodump(dev, &st, buf, sizeof(buf)); 368 count = ds_recv_status_nodump(dev, &st, buf, sizeof(buf));
@@ -391,7 +390,7 @@ static int ds_send_data(struct ds_device *dev, unsigned char *buf, int len)
391 count = 0; 390 count = 0;
392 err = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, dev->ep[EP_DATA_OUT]), buf, len, &count, 1000); 391 err = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, dev->ep[EP_DATA_OUT]), buf, len, &count, 1000);
393 if (err < 0) { 392 if (err < 0) {
394 printk(KERN_ERR "Failed to write 1-wire data to ep0x%x: " 393 pr_err("Failed to write 1-wire data to ep0x%x: "
395 "err=%d.\n", dev->ep[EP_DATA_OUT], err); 394 "err=%d.\n", dev->ep[EP_DATA_OUT], err);
396 return err; 395 return err;
397 } 396 }
@@ -475,7 +474,7 @@ static int ds_wait_status(struct ds_device *dev, struct ds_status *st)
475 } while (!(st->status & ST_IDLE) && !(err < 0) && ++count < 100); 474 } while (!(st->status & ST_IDLE) && !(err < 0) && ++count < 100);
476 475
477 if (err >= 16 && st->status & ST_EPOF) { 476 if (err >= 16 && st->status & ST_EPOF) {
478 printk(KERN_INFO "Resetting device after ST_EPOF.\n"); 477 pr_info("Resetting device after ST_EPOF.\n");
479 ds_reset_device(dev); 478 ds_reset_device(dev);
480 /* Always dump the device status. */ 479 /* Always dump the device status. */
481 count = 101; 480 count = 101;
@@ -992,7 +991,7 @@ static int ds_probe(struct usb_interface *intf,
992 991
993 dev = kzalloc(sizeof(struct ds_device), GFP_KERNEL); 992 dev = kzalloc(sizeof(struct ds_device), GFP_KERNEL);
994 if (!dev) { 993 if (!dev) {
995 printk(KERN_INFO "Failed to allocate new DS9490R structure.\n"); 994 pr_info("Failed to allocate new DS9490R structure.\n");
996 return -ENOMEM; 995 return -ENOMEM;
997 } 996 }
998 dev->udev = usb_get_dev(udev); 997 dev->udev = usb_get_dev(udev);
@@ -1024,7 +1023,8 @@ static int ds_probe(struct usb_interface *intf,
1024 1023
1025 iface_desc = &intf->altsetting[alt]; 1024 iface_desc = &intf->altsetting[alt];
1026 if (iface_desc->desc.bNumEndpoints != NUM_EP-1) { 1025 if (iface_desc->desc.bNumEndpoints != NUM_EP-1) {
1027 printk(KERN_INFO "Num endpoints=%d. It is not DS9490R.\n", iface_desc->desc.bNumEndpoints); 1026 pr_info("Num endpoints=%d. It is not DS9490R.\n",
1027 iface_desc->desc.bNumEndpoints);
1028 err = -EINVAL; 1028 err = -EINVAL;
1029 goto err_out_clear; 1029 goto err_out_clear;
1030 } 1030 }