diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2012-10-05 16:23:52 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2012-10-05 16:23:52 -0400 |
commit | 401e72b55d29f1a08d3dfd7a6a6c2087203b6524 (patch) | |
tree | a671320b905e28f2e4e1cdb23478127aaed7ceda /drivers/i2c | |
parent | 3ddb59d4bcaeca8109ac5eb8ad17368e940ac05e (diff) |
i2c/scx200_*: Replace printks with pr_<level>s
Replace printks with pr_<level>s, add pr_fmt()s to replace NAMEs
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Reviewed-by: Joe Perches <joe@perches.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/scx200_acb.c | 24 | ||||
-rw-r--r-- | drivers/i2c/busses/scx200_i2c.c | 15 |
2 files changed, 18 insertions, 21 deletions
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 2eacb7784d56..08aab57337dd 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -23,6 +23,8 @@ | |||
23 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
27 | |||
26 | #include <linux/module.h> | 28 | #include <linux/module.h> |
27 | #include <linux/errno.h> | 29 | #include <linux/errno.h> |
28 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
@@ -37,8 +39,6 @@ | |||
37 | 39 | ||
38 | #include <linux/scx200.h> | 40 | #include <linux/scx200.h> |
39 | 41 | ||
40 | #define NAME "scx200_acb" | ||
41 | |||
42 | MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); | 42 | MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); |
43 | MODULE_DESCRIPTION("NatSemi SCx200 ACCESS.bus Driver"); | 43 | MODULE_DESCRIPTION("NatSemi SCx200 ACCESS.bus Driver"); |
44 | MODULE_ALIAS("platform:cs5535-smb"); | 44 | MODULE_ALIAS("platform:cs5535-smb"); |
@@ -398,7 +398,7 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface) | |||
398 | outb(0x70, ACBCTL2); | 398 | outb(0x70, ACBCTL2); |
399 | 399 | ||
400 | if (inb(ACBCTL2) != 0x70) { | 400 | if (inb(ACBCTL2) != 0x70) { |
401 | pr_debug(NAME ": ACBCTL2 readback failed\n"); | 401 | pr_debug("ACBCTL2 readback failed\n"); |
402 | return -ENXIO; | 402 | return -ENXIO; |
403 | } | 403 | } |
404 | 404 | ||
@@ -406,8 +406,7 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface) | |||
406 | 406 | ||
407 | val = inb(ACBCTL1); | 407 | val = inb(ACBCTL1); |
408 | if (val) { | 408 | if (val) { |
409 | pr_debug(NAME ": disabled, but ACBCTL1=0x%02x\n", | 409 | pr_debug("disabled, but ACBCTL1=0x%02x\n", val); |
410 | val); | ||
411 | return -ENXIO; | 410 | return -ENXIO; |
412 | } | 411 | } |
413 | 412 | ||
@@ -417,8 +416,8 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface) | |||
417 | 416 | ||
418 | val = inb(ACBCTL1); | 417 | val = inb(ACBCTL1); |
419 | if ((val & ACBCTL1_NMINTE) != ACBCTL1_NMINTE) { | 418 | if ((val & ACBCTL1_NMINTE) != ACBCTL1_NMINTE) { |
420 | pr_debug(NAME ": enabled, but NMINTE won't be set, " | 419 | pr_debug("enabled, but NMINTE won't be set, ACBCTL1=0x%02x\n", |
421 | "ACBCTL1=0x%02x\n", val); | 420 | val); |
422 | return -ENXIO; | 421 | return -ENXIO; |
423 | } | 422 | } |
424 | 423 | ||
@@ -433,7 +432,7 @@ static __devinit struct scx200_acb_iface *scx200_create_iface(const char *text, | |||
433 | 432 | ||
434 | iface = kzalloc(sizeof(*iface), GFP_KERNEL); | 433 | iface = kzalloc(sizeof(*iface), GFP_KERNEL); |
435 | if (!iface) { | 434 | if (!iface) { |
436 | printk(KERN_ERR NAME ": can't allocate memory\n"); | 435 | pr_err("can't allocate memory\n"); |
437 | return NULL; | 436 | return NULL; |
438 | } | 437 | } |
439 | 438 | ||
@@ -459,14 +458,14 @@ static int __devinit scx200_acb_create(struct scx200_acb_iface *iface) | |||
459 | 458 | ||
460 | rc = scx200_acb_probe(iface); | 459 | rc = scx200_acb_probe(iface); |
461 | if (rc) { | 460 | if (rc) { |
462 | printk(KERN_WARNING NAME ": probe failed\n"); | 461 | pr_warn("probe failed\n"); |
463 | return rc; | 462 | return rc; |
464 | } | 463 | } |
465 | 464 | ||
466 | scx200_acb_reset(iface); | 465 | scx200_acb_reset(iface); |
467 | 466 | ||
468 | if (i2c_add_adapter(adapter) < 0) { | 467 | if (i2c_add_adapter(adapter) < 0) { |
469 | printk(KERN_ERR NAME ": failed to register\n"); | 468 | pr_err("failed to register\n"); |
470 | return -ENODEV; | 469 | return -ENODEV; |
471 | } | 470 | } |
472 | 471 | ||
@@ -493,8 +492,7 @@ static struct scx200_acb_iface * __devinit scx200_create_dev(const char *text, | |||
493 | return NULL; | 492 | return NULL; |
494 | 493 | ||
495 | if (!request_region(base, 8, iface->adapter.name)) { | 494 | if (!request_region(base, 8, iface->adapter.name)) { |
496 | printk(KERN_ERR NAME ": can't allocate io 0x%lx-0x%lx\n", | 495 | pr_err("can't allocate io 0x%lx-0x%lx\n", base, base + 8 - 1); |
497 | base, base + 8 - 1); | ||
498 | goto errout_free; | 496 | goto errout_free; |
499 | } | 497 | } |
500 | 498 | ||
@@ -583,7 +581,7 @@ static __init void scx200_scan_isa(void) | |||
583 | 581 | ||
584 | static int __init scx200_acb_init(void) | 582 | static int __init scx200_acb_init(void) |
585 | { | 583 | { |
586 | pr_debug(NAME ": NatSemi SCx200 ACCESS.bus Driver\n"); | 584 | pr_debug("NatSemi SCx200 ACCESS.bus Driver\n"); |
587 | 585 | ||
588 | /* First scan for ISA-based devices */ | 586 | /* First scan for ISA-based devices */ |
589 | scx200_scan_isa(); /* XXX: should we care about errors? */ | 587 | scx200_scan_isa(); /* XXX: should we care about errors? */ |
diff --git a/drivers/i2c/busses/scx200_i2c.c b/drivers/i2c/busses/scx200_i2c.c index 7ee0d502ceab..ae1258b95d60 100644 --- a/drivers/i2c/busses/scx200_i2c.c +++ b/drivers/i2c/busses/scx200_i2c.c | |||
@@ -21,6 +21,8 @@ | |||
21 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
25 | |||
24 | #include <linux/module.h> | 26 | #include <linux/module.h> |
25 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
26 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
@@ -31,8 +33,6 @@ | |||
31 | 33 | ||
32 | #include <linux/scx200_gpio.h> | 34 | #include <linux/scx200_gpio.h> |
33 | 35 | ||
34 | #define NAME "scx200_i2c" | ||
35 | |||
36 | MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); | 36 | MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); |
37 | MODULE_DESCRIPTION("NatSemi SCx200 I2C Driver"); | 37 | MODULE_DESCRIPTION("NatSemi SCx200 I2C Driver"); |
38 | MODULE_LICENSE("GPL"); | 38 | MODULE_LICENSE("GPL"); |
@@ -88,17 +88,17 @@ static struct i2c_adapter scx200_i2c_ops = { | |||
88 | 88 | ||
89 | static int scx200_i2c_init(void) | 89 | static int scx200_i2c_init(void) |
90 | { | 90 | { |
91 | pr_debug(NAME ": NatSemi SCx200 I2C Driver\n"); | 91 | pr_debug("NatSemi SCx200 I2C Driver\n"); |
92 | 92 | ||
93 | if (!scx200_gpio_present()) { | 93 | if (!scx200_gpio_present()) { |
94 | printk(KERN_ERR NAME ": no SCx200 gpio pins available\n"); | 94 | pr_err("no SCx200 gpio pins available\n"); |
95 | return -ENODEV; | 95 | return -ENODEV; |
96 | } | 96 | } |
97 | 97 | ||
98 | pr_debug(NAME ": SCL=GPIO%02u, SDA=GPIO%02u\n", scl, sda); | 98 | pr_debug("SCL=GPIO%02u, SDA=GPIO%02u\n", scl, sda); |
99 | 99 | ||
100 | if (scl == -1 || sda == -1 || scl == sda) { | 100 | if (scl == -1 || sda == -1 || scl == sda) { |
101 | printk(KERN_ERR NAME ": scl and sda must be specified\n"); | 101 | pr_err("scl and sda must be specified\n"); |
102 | return -EINVAL; | 102 | return -EINVAL; |
103 | } | 103 | } |
104 | 104 | ||
@@ -107,8 +107,7 @@ static int scx200_i2c_init(void) | |||
107 | scx200_gpio_configure(sda, ~2, 5); | 107 | scx200_gpio_configure(sda, ~2, 5); |
108 | 108 | ||
109 | if (i2c_bit_add_bus(&scx200_i2c_ops) < 0) { | 109 | if (i2c_bit_add_bus(&scx200_i2c_ops) < 0) { |
110 | printk(KERN_ERR NAME ": adapter %s registration failed\n", | 110 | pr_err("adapter %s registration failed\n", scx200_i2c_ops.name); |
111 | scx200_i2c_ops.name); | ||
112 | return -ENODEV; | 111 | return -ENODEV; |
113 | } | 112 | } |
114 | 113 | ||