提交 874e955b 编写于 作者: W Wolfram Sang

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: NWolfram Sang <wsa@the-dreams.de>
上级 42fa278d
......@@ -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 = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册