* [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type
@ 2011-10-14 13:31 Wolfram Sang
2011-10-14 13:32 ` [PATCH 2/2] gpio: pca953x: propagate the errno from the chip_init functions Wolfram Sang
2011-10-29 6:58 ` [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type Wolfram Sang
0 siblings, 2 replies; 4+ messages in thread
From: Wolfram Sang @ 2011-10-14 13:31 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, Grant Likely
We can assume our own device_id table is correct, so remove checking if
the chip type is valid. (The check was bogus anyway: If it found an
invalid entry, it returned with 0!) This is in preparation for further
cleanups.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
drivers/gpio/gpio-pca953x.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index c43b8ff..45de6a4 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -673,10 +673,8 @@ static int __devinit pca953x_probe(struct i2c_client *client,
if (chip->chip_type == PCA953X_TYPE)
device_pca953x_init(chip, invert);
- else if (chip->chip_type == PCA957X_TYPE)
- device_pca957x_init(chip, invert);
else
- goto out_failed;
+ device_pca957x_init(chip, invert);
ret = pca953x_irq_setup(chip, id, irq_base);
if (ret)
--
1.7.6.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] gpio: pca953x: propagate the errno from the chip_init functions
2011-10-14 13:31 [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type Wolfram Sang
@ 2011-10-14 13:32 ` Wolfram Sang
2011-10-29 6:58 ` [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type Wolfram Sang
1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2011-10-14 13:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Wolfram Sang, Grant Likely
Initializing the chips may return with an error, but this error gets
dropped in probe(). Propagate this further to the driver core. Also,
simplify returning the error in one of the init functions.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
drivers/gpio/gpio-pca953x.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 45de6a4..a3fef0c 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -595,9 +595,6 @@ static int __devinit device_pca953x_init(struct pca953x_chip *chip, int invert)
/* set platform specific polarity inversion */
ret = pca953x_write_reg(chip, PCA953X_INVERT, invert);
- if (ret)
- goto out;
- return 0;
out:
return ret;
}
@@ -639,7 +636,7 @@ static int __devinit pca953x_probe(struct i2c_client *client,
struct pca953x_platform_data *pdata;
struct pca953x_chip *chip;
int irq_base=0, invert=0;
- int ret = 0;
+ int ret;
chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL);
if (chip == NULL)
@@ -672,9 +669,11 @@ static int __devinit pca953x_probe(struct i2c_client *client,
pca953x_setup_gpio(chip, id->driver_data & PCA_GPIO_MASK);
if (chip->chip_type == PCA953X_TYPE)
- device_pca953x_init(chip, invert);
+ ret = device_pca953x_init(chip, invert);
else
- device_pca957x_init(chip, invert);
+ ret = device_pca957x_init(chip, invert);
+ if (ret)
+ goto out_failed;
ret = pca953x_irq_setup(chip, id, irq_base);
if (ret)
--
1.7.6.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type
2011-10-14 13:31 [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type Wolfram Sang
2011-10-14 13:32 ` [PATCH 2/2] gpio: pca953x: propagate the errno from the chip_init functions Wolfram Sang
@ 2011-10-29 6:58 ` Wolfram Sang
2011-10-29 10:26 ` Grant Likely
1 sibling, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2011-10-29 6:58 UTC (permalink / raw)
To: linux-kernel; +Cc: Grant Likely
[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]
On Fri, Oct 14, 2011 at 03:31:59PM +0200, Wolfram Sang wrote:
> We can assume our own device_id table is correct, so remove checking if
> the chip type is valid. (The check was bogus anyway: If it found an
> invalid entry, it returned with 0!) This is in preparation for further
> cleanups.
>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
Ping for this mini-series.
> ---
> drivers/gpio/gpio-pca953x.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index c43b8ff..45de6a4 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -673,10 +673,8 @@ static int __devinit pca953x_probe(struct i2c_client *client,
>
> if (chip->chip_type == PCA953X_TYPE)
> device_pca953x_init(chip, invert);
> - else if (chip->chip_type == PCA957X_TYPE)
> - device_pca957x_init(chip, invert);
> else
> - goto out_failed;
> + device_pca957x_init(chip, invert);
>
> ret = pca953x_irq_setup(chip, id, irq_base);
> if (ret)
> --
> 1.7.6.3
>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type
2011-10-29 6:58 ` [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type Wolfram Sang
@ 2011-10-29 10:26 ` Grant Likely
0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2011-10-29 10:26 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-kernel
On Sat, Oct 29, 2011 at 08:58:20AM +0200, Wolfram Sang wrote:
> On Fri, Oct 14, 2011 at 03:31:59PM +0200, Wolfram Sang wrote:
> > We can assume our own device_id table is correct, so remove checking if
> > the chip type is valid. (The check was bogus anyway: If it found an
> > invalid entry, it returned with 0!) This is in preparation for further
> > cleanups.
> >
> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
>
> Ping for this mini-series.
Merged and I'll push out for 3.2, thanks.
g.
>
> > ---
> > drivers/gpio/gpio-pca953x.c | 4 +---
> > 1 files changed, 1 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> > index c43b8ff..45de6a4 100644
> > --- a/drivers/gpio/gpio-pca953x.c
> > +++ b/drivers/gpio/gpio-pca953x.c
> > @@ -673,10 +673,8 @@ static int __devinit pca953x_probe(struct i2c_client *client,
> >
> > if (chip->chip_type == PCA953X_TYPE)
> > device_pca953x_init(chip, invert);
> > - else if (chip->chip_type == PCA957X_TYPE)
> > - device_pca957x_init(chip, invert);
> > else
> > - goto out_failed;
> > + device_pca957x_init(chip, invert);
> >
> > ret = pca953x_irq_setup(chip, id, irq_base);
> > if (ret)
> > --
> > 1.7.6.3
> >
>
> --
> Pengutronix e.K. | Wolfram Sang |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-29 10:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14 13:31 [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type Wolfram Sang
2011-10-14 13:32 ` [PATCH 2/2] gpio: pca953x: propagate the errno from the chip_init functions Wolfram Sang
2011-10-29 6:58 ` [PATCH 1/2] gpio: pca953x: remove unneeded check for chip type Wolfram Sang
2011-10-29 10:26 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox