Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5cd6e675f862568ad73c061665ee5080cfd952c5
Commit:     5cd6e675f862568ad73c061665ee5080cfd952c5
Parent:     f9dd0194ff23d612e463be764d73da7825da4aa1
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 14 21:53:31 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Mon Jan 14 21:53:31 2008 +0100

    i2c-sibyte: Fix an error path
    
    If the registration of the second I2C channel fails, we really want to
    unregister the first one before we return with an error.
    
    While we're here, fix the printk right above so that it displays the
    real driver name.
    
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
    Cc: Ralf Baechle <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/i2c-sibyte.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c
index 0ca599d..503a134 100644
--- a/drivers/i2c/busses/i2c-sibyte.c
+++ b/drivers/i2c/busses/i2c-sibyte.c
@@ -200,11 +200,14 @@ static struct i2c_adapter sibyte_board_adapter[2] = {
 
 static int __init i2c_sibyte_init(void)
 {
-       printk("i2c-swarm.o: i2c SMBus adapter module for SiByte board\n");
+       pr_info("i2c-sibyte: i2c SMBus adapter module for SiByte board\n");
        if (i2c_sibyte_add_bus(&sibyte_board_adapter[0], K_SMB_FREQ_100KHZ) < 0)
                return -ENODEV;
-       if (i2c_sibyte_add_bus(&sibyte_board_adapter[1], K_SMB_FREQ_400KHZ) < 0)
+       if (i2c_sibyte_add_bus(&sibyte_board_adapter[1],
+                              K_SMB_FREQ_400KHZ) < 0) {
+               i2c_del_adapter(&sibyte_board_adapter[0]);
                return -ENODEV;
+       }
        return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to