diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2013-07-11 22:02:03 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2013-08-21 11:34:25 +0200 |
commit | 874e955b171f0505e2371c1ca80a2188efdc217d (patch) | |
tree | 01b14cb539a6e6b4178e764f0f66ee550c964632 | |
parent | 42fa278d70e7caee728f6f3e563d1aaaf9c521aa (diff) | |
download | op-kernel-dev-874e955b171f0505e2371c1ca80a2188efdc217d.zip op-kernel-dev-874e955b171f0505e2371c1ca80a2188efdc217d.tar.gz |
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>
-rw-r--r-- | drivers/i2c/busses/i2c-powermac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index 5a88364..06858d5 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) printk(KERN_ERR "i2c-powermac: Adapter %s registration " "failed\n", adapter->name); memset(adapter, 0, sizeof(*adapter)); + return rc; } printk(KERN_INFO "PowerMac i2c bus %s registered\n", adapter->name); @@ -455,7 +456,7 @@ static int i2c_powermac_probe(struct platform_device *dev) */ i2c_powermac_register_devices(adapter, bus); - return rc; + return 0; } static struct platform_driver i2c_powermac_driver = { |