* [PATCH] i2c: powermac: fix return path on error
@ 2013-08-19 13:18 Wolfram Sang
2013-08-27 7:42 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2013-08-19 13:18 UTC (permalink / raw)
To: linux-i2c; +Cc: Wolfram Sang, linuxppc-dev
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>
---
drivers/i2c/busses/i2c-powermac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index 8dc90da..bb81773 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 = {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c: powermac: fix return path on error
2013-08-19 13:18 [PATCH] i2c: powermac: fix return path on error Wolfram Sang
@ 2013-08-27 7:42 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-27 7:42 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev, linux-i2c
On Mon, 2013-08-19 at 15:18 +0200, Wolfram Sang wrote:
> 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>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> drivers/i2c/busses/i2c-powermac.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
> index 8dc90da..bb81773 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 = {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-27 7:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-19 13:18 [PATCH] i2c: powermac: fix return path on error Wolfram Sang
2013-08-27 7:42 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).