aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2013-07-11 17:02:03 -0400
committerWolfram Sang <wsa@the-dreams.de>2013-08-21 05:34:25 -0400
commit874e955b171f0505e2371c1ca80a2188efdc217d (patch)
tree01b14cb539a6e6b4178e764f0f66ee550c964632 /drivers/i2c
parent42fa278d70e7caee728f6f3e563d1aaaf9c521aa (diff)
i2c: powermac: fix return path on error
We want to bail out immediately if i2c_add_adapter failed and not try to register child nodes with a nilled adapter structure. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-powermac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index 5a88364a542b..06858d576552 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -446,6 +446,7 @@ static int i2c_powermac_probe(struct platform_device *dev)
446 printk(KERN_ERR "i2c-powermac: Adapter %s registration " 446 printk(KERN_ERR "i2c-powermac: Adapter %s registration "
447 "failed\n", adapter->name); 447 "failed\n", adapter->name);
448 memset(adapter, 0, sizeof(*adapter)); 448 memset(adapter, 0, sizeof(*adapter));
449 return rc;
449 } 450 }
450 451
451 printk(KERN_INFO "PowerMac i2c bus %s registered\n", adapter->name); 452 printk(KERN_INFO "PowerMac i2c bus %s registered\n", adapter->name);
@@ -455,7 +456,7 @@ static int i2c_powermac_probe(struct platform_device *dev)
455 */ 456 */
456 i2c_powermac_register_devices(adapter, bus); 457 i2c_powermac_register_devices(adapter, bus);
457 458
458 return rc; 459 return 0;
459} 460}
460 461
461static struct platform_driver i2c_powermac_driver = { 462static struct platform_driver i2c_powermac_driver = {