public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths
@ 2011-07-13  5:20 Axel Lin
  2011-07-13  8:01 ` Sebastian Andrzej Siewior
  2011-07-13 21:32 ` Ben Dooks
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2011-07-13  5:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sebastian Andrzej Siewior, Dirk Brandewie, Jean Delvare,
	Ben Dooks, linux-i2c

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/i2c/busses/i2c-pxa-pci.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c
index 6659d26..b73da6c 100644
--- a/drivers/i2c/busses/i2c-pxa-pci.c
+++ b/drivers/i2c/busses/i2c-pxa-pci.c
@@ -109,12 +109,15 @@ static int __devinit ce4100_i2c_probe(struct pci_dev *dev,
 		return -EINVAL;
 	}
 	sds = kzalloc(sizeof(*sds), GFP_KERNEL);
-	if (!sds)
+	if (!sds) {
+		ret = -ENOMEM;
 		goto err_mem;
+	}
 
 	for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) {
 		sds->pdev[i] = add_i2c_device(dev, i);
 		if (IS_ERR(sds->pdev[i])) {
+			ret = PTR_ERR(sds->pdev[i]);
 			while (--i >= 0)
 				platform_device_unregister(sds->pdev[i]);
 			goto err_dev_add;
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths
  2011-07-13  5:20 [PATCH] i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths Axel Lin
@ 2011-07-13  8:01 ` Sebastian Andrzej Siewior
  2011-07-13 21:32 ` Ben Dooks
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2011-07-13  8:01 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Dirk Brandewie, Jean Delvare, Ben Dooks, linux-i2c

Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Sebastian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths
  2011-07-13  5:20 [PATCH] i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths Axel Lin
  2011-07-13  8:01 ` Sebastian Andrzej Siewior
@ 2011-07-13 21:32 ` Ben Dooks
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Dooks @ 2011-07-13 21:32 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Sebastian Andrzej Siewior, Dirk Brandewie,
	Jean Delvare, Ben Dooks, linux-i2c

On Wed, Jul 13, 2011 at 01:20:39PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

thanks, will apply

> ---
>  drivers/i2c/busses/i2c-pxa-pci.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c
> index 6659d26..b73da6c 100644
> --- a/drivers/i2c/busses/i2c-pxa-pci.c
> +++ b/drivers/i2c/busses/i2c-pxa-pci.c
> @@ -109,12 +109,15 @@ static int __devinit ce4100_i2c_probe(struct pci_dev *dev,
>  		return -EINVAL;
>  	}
>  	sds = kzalloc(sizeof(*sds), GFP_KERNEL);
> -	if (!sds)
> +	if (!sds) {
> +		ret = -ENOMEM;
>  		goto err_mem;
> +	}
>  
>  	for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) {
>  		sds->pdev[i] = add_i2c_device(dev, i);
>  		if (IS_ERR(sds->pdev[i])) {
> +			ret = PTR_ERR(sds->pdev[i]);
>  			while (--i >= 0)
>  				platform_device_unregister(sds->pdev[i]);
>  			goto err_dev_add;
> -- 
> 1.7.4.1
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-14  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-13  5:20 [PATCH] i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths Axel Lin
2011-07-13  8:01 ` Sebastian Andrzej Siewior
2011-07-13 21:32 ` Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox