Commit 401e72b5 authored by Jim Cromie's avatar Jim Cromie Committed by Jean Delvare

i2c/scx200_*: Replace printks with pr_<level>s

Replace printks with pr_<level>s, add pr_fmt()s to replace NAMEs
Signed-off-by: default avatarJim Cromie <jim.cromie@gmail.com>
Reviewed-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 3ddb59d4
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -37,8 +39,6 @@ ...@@ -37,8 +39,6 @@
#include <linux/scx200.h> #include <linux/scx200.h>
#define NAME "scx200_acb"
MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
MODULE_DESCRIPTION("NatSemi SCx200 ACCESS.bus Driver"); MODULE_DESCRIPTION("NatSemi SCx200 ACCESS.bus Driver");
MODULE_ALIAS("platform:cs5535-smb"); MODULE_ALIAS("platform:cs5535-smb");
...@@ -398,7 +398,7 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface) ...@@ -398,7 +398,7 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface)
outb(0x70, ACBCTL2); outb(0x70, ACBCTL2);
if (inb(ACBCTL2) != 0x70) { if (inb(ACBCTL2) != 0x70) {
pr_debug(NAME ": ACBCTL2 readback failed\n"); pr_debug("ACBCTL2 readback failed\n");
return -ENXIO; return -ENXIO;
} }
...@@ -406,8 +406,7 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface) ...@@ -406,8 +406,7 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface)
val = inb(ACBCTL1); val = inb(ACBCTL1);
if (val) { if (val) {
pr_debug(NAME ": disabled, but ACBCTL1=0x%02x\n", pr_debug("disabled, but ACBCTL1=0x%02x\n", val);
val);
return -ENXIO; return -ENXIO;
} }
...@@ -417,8 +416,8 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface) ...@@ -417,8 +416,8 @@ static __devinit int scx200_acb_probe(struct scx200_acb_iface *iface)
val = inb(ACBCTL1); val = inb(ACBCTL1);
if ((val & ACBCTL1_NMINTE) != ACBCTL1_NMINTE) { if ((val & ACBCTL1_NMINTE) != ACBCTL1_NMINTE) {
pr_debug(NAME ": enabled, but NMINTE won't be set, " pr_debug("enabled, but NMINTE won't be set, ACBCTL1=0x%02x\n",
"ACBCTL1=0x%02x\n", val); val);
return -ENXIO; return -ENXIO;
} }
...@@ -433,7 +432,7 @@ static __devinit struct scx200_acb_iface *scx200_create_iface(const char *text, ...@@ -433,7 +432,7 @@ static __devinit struct scx200_acb_iface *scx200_create_iface(const char *text,
iface = kzalloc(sizeof(*iface), GFP_KERNEL); iface = kzalloc(sizeof(*iface), GFP_KERNEL);
if (!iface) { if (!iface) {
printk(KERN_ERR NAME ": can't allocate memory\n"); pr_err("can't allocate memory\n");
return NULL; return NULL;
} }
...@@ -459,14 +458,14 @@ static int __devinit scx200_acb_create(struct scx200_acb_iface *iface) ...@@ -459,14 +458,14 @@ static int __devinit scx200_acb_create(struct scx200_acb_iface *iface)
rc = scx200_acb_probe(iface); rc = scx200_acb_probe(iface);
if (rc) { if (rc) {
printk(KERN_WARNING NAME ": probe failed\n"); pr_warn("probe failed\n");
return rc; return rc;
} }
scx200_acb_reset(iface); scx200_acb_reset(iface);
if (i2c_add_adapter(adapter) < 0) { if (i2c_add_adapter(adapter) < 0) {
printk(KERN_ERR NAME ": failed to register\n"); pr_err("failed to register\n");
return -ENODEV; return -ENODEV;
} }
...@@ -493,8 +492,7 @@ static struct scx200_acb_iface * __devinit scx200_create_dev(const char *text, ...@@ -493,8 +492,7 @@ static struct scx200_acb_iface * __devinit scx200_create_dev(const char *text,
return NULL; return NULL;
if (!request_region(base, 8, iface->adapter.name)) { if (!request_region(base, 8, iface->adapter.name)) {
printk(KERN_ERR NAME ": can't allocate io 0x%lx-0x%lx\n", pr_err("can't allocate io 0x%lx-0x%lx\n", base, base + 8 - 1);
base, base + 8 - 1);
goto errout_free; goto errout_free;
} }
...@@ -583,7 +581,7 @@ static __init void scx200_scan_isa(void) ...@@ -583,7 +581,7 @@ static __init void scx200_scan_isa(void)
static int __init scx200_acb_init(void) static int __init scx200_acb_init(void)
{ {
pr_debug(NAME ": NatSemi SCx200 ACCESS.bus Driver\n"); pr_debug("NatSemi SCx200 ACCESS.bus Driver\n");
/* First scan for ISA-based devices */ /* First scan for ISA-based devices */
scx200_scan_isa(); /* XXX: should we care about errors? */ scx200_scan_isa(); /* XXX: should we care about errors? */
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -31,8 +33,6 @@ ...@@ -31,8 +33,6 @@
#include <linux/scx200_gpio.h> #include <linux/scx200_gpio.h>
#define NAME "scx200_i2c"
MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
MODULE_DESCRIPTION("NatSemi SCx200 I2C Driver"); MODULE_DESCRIPTION("NatSemi SCx200 I2C Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -88,17 +88,17 @@ static struct i2c_adapter scx200_i2c_ops = { ...@@ -88,17 +88,17 @@ static struct i2c_adapter scx200_i2c_ops = {
static int scx200_i2c_init(void) static int scx200_i2c_init(void)
{ {
pr_debug(NAME ": NatSemi SCx200 I2C Driver\n"); pr_debug("NatSemi SCx200 I2C Driver\n");
if (!scx200_gpio_present()) { if (!scx200_gpio_present()) {
printk(KERN_ERR NAME ": no SCx200 gpio pins available\n"); pr_err("no SCx200 gpio pins available\n");
return -ENODEV; return -ENODEV;
} }
pr_debug(NAME ": SCL=GPIO%02u, SDA=GPIO%02u\n", scl, sda); pr_debug("SCL=GPIO%02u, SDA=GPIO%02u\n", scl, sda);
if (scl == -1 || sda == -1 || scl == sda) { if (scl == -1 || sda == -1 || scl == sda) {
printk(KERN_ERR NAME ": scl and sda must be specified\n"); pr_err("scl and sda must be specified\n");
return -EINVAL; return -EINVAL;
} }
...@@ -107,8 +107,7 @@ static int scx200_i2c_init(void) ...@@ -107,8 +107,7 @@ static int scx200_i2c_init(void)
scx200_gpio_configure(sda, ~2, 5); scx200_gpio_configure(sda, ~2, 5);
if (i2c_bit_add_bus(&scx200_i2c_ops) < 0) { if (i2c_bit_add_bus(&scx200_i2c_ops) < 0) {
printk(KERN_ERR NAME ": adapter %s registration failed\n", pr_err("adapter %s registration failed\n", scx200_i2c_ops.name);
scx200_i2c_ops.name);
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment