mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
i2c: parport: start using pr_fmt
Start using pr_fmt and convert all remaining printk to use pr_* family of macros. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> [wsa: remove print on kzalloc failure] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
c5f3d544a7
commit
20226118bc
@ -20,6 +20,8 @@
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
* ------------------------------------------------------------------------ */
|
* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) "i2c-parport: " fmt
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@ -176,26 +178,24 @@ static void i2c_parport_attach(struct parport *port)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == MAX_DEVICE) {
|
if (i == MAX_DEVICE) {
|
||||||
pr_debug("i2c-parport: Not using parport%d.\n", port->number);
|
pr_debug("Not using parport%d.\n", port->number);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = kzalloc(sizeof(struct i2c_par), GFP_KERNEL);
|
adapter = kzalloc(sizeof(struct i2c_par), GFP_KERNEL);
|
||||||
if (adapter == NULL) {
|
if (!adapter)
|
||||||
printk(KERN_ERR "i2c-parport: Failed to kzalloc\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
memset(&i2c_parport_cb, 0, sizeof(i2c_parport_cb));
|
memset(&i2c_parport_cb, 0, sizeof(i2c_parport_cb));
|
||||||
i2c_parport_cb.flags = PARPORT_FLAG_EXCL;
|
i2c_parport_cb.flags = PARPORT_FLAG_EXCL;
|
||||||
i2c_parport_cb.irq_func = i2c_parport_irq;
|
i2c_parport_cb.irq_func = i2c_parport_irq;
|
||||||
i2c_parport_cb.private = adapter;
|
i2c_parport_cb.private = adapter;
|
||||||
|
|
||||||
pr_debug("i2c-parport: attaching to %s\n", port->name);
|
pr_debug("attaching to %s\n", port->name);
|
||||||
parport_disable_irq(port);
|
parport_disable_irq(port);
|
||||||
adapter->pdev = parport_register_dev_model(port, "i2c-parport",
|
adapter->pdev = parport_register_dev_model(port, "i2c-parport",
|
||||||
&i2c_parport_cb, i);
|
&i2c_parport_cb, i);
|
||||||
if (!adapter->pdev) {
|
if (!adapter->pdev) {
|
||||||
printk(KERN_ERR "i2c-parport: Unable to register with parport\n");
|
pr_err("Unable to register with parport\n");
|
||||||
goto err_free;
|
goto err_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,12 +299,12 @@ static struct parport_driver i2c_parport_driver = {
|
|||||||
static int __init i2c_parport_init(void)
|
static int __init i2c_parport_init(void)
|
||||||
{
|
{
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
|
pr_warn("adapter type unspecified\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type >= ARRAY_SIZE(adapter_parm)) {
|
if (type >= ARRAY_SIZE(adapter_parm)) {
|
||||||
printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
|
pr_warn("invalid type (%d)\n", type);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user