[i2c] [PATCH] i2c-ali1563: Improve the status messages
Jean Delvare
khali at linux-fr.org
Sun Dec 10 11:04:47 CET 2006
Improve the status messages printed by the i2c-ali1563 driver.
Signed-off-by: Jean Delvare <khali at linux-fr.org>
---
drivers/i2c/busses/i2c-ali1563.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- linux-2.6.19-git.orig/drivers/i2c/busses/i2c-ali1563.c 2006-12-09 16:58:57.000000000 +0100
+++ linux-2.6.19-git/drivers/i2c/busses/i2c-ali1563.c 2006-12-10 10:54:57.000000000 +0100
@@ -328,7 +328,6 @@
u16 ctrl;
pci_read_config_word(dev,ALI1563_SMBBA,&ctrl);
- printk("ali1563: SMBus control = %04x\n",ctrl);
/* Check if device is even enabled first */
if (!(ctrl & ALI1563_SMB_IOEN)) {
@@ -356,6 +355,7 @@
dev_warn(&dev->dev,"Could not allocate I/O space");
goto Err;
}
+ dev_info(&dev->dev, "Found ALi1563 SMBus at 0x%04x\n", ali1563_smba);
return 0;
Err:
@@ -384,13 +384,18 @@
int error;
if ((error = ali1563_setup(dev)))
- return error;
+ goto exit;
ali1563_adapter.dev.parent = &dev->dev;
sprintf(ali1563_adapter.name,"SMBus ALi 1563 Adapter @ %04x",
ali1563_smba);
if ((error = i2c_add_adapter(&ali1563_adapter)))
- ali1563_shutdown(dev);
- printk("%s: Returning %d\n",__FUNCTION__,error);
+ goto exit_shutdown;
+ return 0;
+
+exit_shutdown:
+ ali1563_shutdown(dev);
+exit:
+ dev_warn(&dev->dev, "ALi1563 SMBus probe failed (%d)\n", error);
return error;
}
--
Jean Delvare
More information about the i2c
mailing list