linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: remove remaining users of gpiochip_remove() retval
@ 2014-09-30 14:15 Pramod Gurav
  2014-09-30 14:15 ` [PATCH 2/2] mfd: remove use " Pramod Gurav
  2014-10-01  7:43 ` [PATCH 1/2] gpio: remove remaining users " Linus Walleij
  0 siblings, 2 replies; 8+ messages in thread
From: Pramod Gurav @ 2014-09-30 14:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Pramod Gurav, Linus Walleij, Alexandre Courbot, linux-gpio

Some driver in gpio still check for return value from gpiochip_remove
Get rid of the check for return value.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-gpio@vger.kernel.org

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
---
 drivers/gpio/gpio-crystalcove.c |   12 ++++--------
 drivers/gpio/gpio-omap.c        |    2 +-
 drivers/gpio/gpio-zynq.c        |   10 ++--------
 3 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c
index 934462f..0345b94 100644
--- a/drivers/gpio/gpio-crystalcove.c
+++ b/drivers/gpio/gpio-crystalcove.c
@@ -346,22 +346,18 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
 	return 0;
 
 out_remove_gpio:
-	WARN_ON(gpiochip_remove(&cg->chip));
+	gpiochip_remove(&cg->chip);
 	return retval;
 }
 
 static int crystalcove_gpio_remove(struct platform_device *pdev)
 {
 	struct crystalcove_gpio *cg = platform_get_drvdata(pdev);
-	int irq = platform_get_irq(pdev, 0);
-	int err;
-
-	err = gpiochip_remove(&cg->chip);
+	platform_get_irq(pdev, 0);
 
-	if (irq >= 0)
-		free_irq(irq, cg);
+	gpiochip_remove(&cg->chip);
 
-	return err;
+	return 0;
 }
 
 static struct platform_driver crystalcove_gpio_driver = {
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 1749321..5cd3367 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1143,7 +1143,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank)
 
 	if (ret) {
 		dev_err(bank->dev, "Couldn't add irqchip to gpiochip %d\n", ret);
-		ret = gpiochip_remove(&bank->chip);
+		gpiochip_remove(&bank->chip);
 		return -ENODEV;
 	}
 
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 31ad5df..13c677a 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -648,8 +648,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
 	return 0;
 
 err_rm_gpiochip:
-	if (gpiochip_remove(chip))
-		dev_err(&pdev->dev, "Failed to remove gpio chip\n");
+	gpiochip_remove(chip);
 err_disable_clk:
 	clk_disable_unprepare(gpio->clk);
 
@@ -664,16 +663,11 @@ err_disable_clk:
  */
 static int zynq_gpio_remove(struct platform_device *pdev)
 {
-	int ret;
 	struct zynq_gpio *gpio = platform_get_drvdata(pdev);
 
 	pm_runtime_get_sync(&pdev->dev);
 
-	ret = gpiochip_remove(&gpio->chip);
-	if (ret) {
-		dev_err(&pdev->dev, "Failed to remove gpio chip\n");
-		return ret;
-	}
+	gpiochip_remove(&gpio->chip);
 	clk_disable_unprepare(gpio->clk);
 	device_set_wakeup_capable(&pdev->dev, 0);
 	return 0;
-- 
1.7.9.5


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

* [PATCH 2/2] mfd: remove use of gpiochip_remove() retval
  2014-09-30 14:15 [PATCH 1/2] gpio: remove remaining users of gpiochip_remove() retval Pramod Gurav
@ 2014-09-30 14:15 ` Pramod Gurav
  2014-10-01  7:45   ` Linus Walleij
  2014-10-01  7:43 ` [PATCH 1/2] gpio: remove remaining users " Linus Walleij
  1 sibling, 1 reply; 8+ messages in thread
From: Pramod Gurav @ 2014-09-30 14:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Pramod Gurav, Linus Walleij, Alexandre Courbot, Samuel Ortiz,
	Lee Jones, linux-gpio

Get rid of using return value from gpiochip_remove() as it returns
void.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
CC: Lee Jones <lee.jones@linaro.org>
Cc: linux-gpio@vger.kernel.org

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
---
 drivers/mfd/asic3.c        |    3 ++-
 drivers/mfd/htc-i2cpld.c   |    6 +-----
 drivers/mfd/sm501.c        |   17 +++--------------
 drivers/mfd/tc6393xb.c     |   13 ++++---------
 drivers/mfd/ucb1x00-core.c |    8 ++------
 5 files changed, 12 insertions(+), 35 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 9fc4186..977bd3a 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -605,7 +605,8 @@ static int asic3_gpio_remove(struct platform_device *pdev)
 {
 	struct asic3 *asic = platform_get_drvdata(pdev);
 
-	return gpiochip_remove(&asic->gpio);
+	gpiochip_remove(&asic->gpio);
+	return 0;
 }
 
 static void asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index 6bdb78c..e14fe3e 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -481,14 +481,10 @@ static int htcpld_register_chip_gpio(
 
 	ret = gpiochip_add(&(chip->chip_in));
 	if (ret) {
-		int error;
-
 		dev_warn(dev, "Unable to register input GPIOs for 0x%x: %d\n",
 			 plat_chip_data->addr, ret);
 
-		error = gpiochip_remove(&(chip->chip_out));
-		if (error)
-			dev_warn(dev, "Error while trying to unregister gpio chip: %d\n", error);
+		gpiochip_remove(&(chip->chip_out));
 
 		return ret;
 	}
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 81e6d09..02027b7 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -1047,7 +1047,6 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
 	struct sm501_gpio *gpio = &sm->gpio;
 	resource_size_t iobase = sm->io_res->start + SM501_GPIO;
 	int ret;
-	int tmp;
 
 	dev_dbg(sm->dev, "registering gpio block %08llx\n",
 		(unsigned long long)iobase);
@@ -1086,11 +1085,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
 	return 0;
 
  err_low_chip:
-	tmp = gpiochip_remove(&gpio->low.gpio);
-	if (tmp) {
-		dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");
-		return ret;
-	}
+	gpiochip_remove(&gpio->low.gpio);
 
  err_mapped:
 	iounmap(gpio->regs);
@@ -1105,18 +1100,12 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
 static void sm501_gpio_remove(struct sm501_devdata *sm)
 {
 	struct sm501_gpio *gpio = &sm->gpio;
-	int ret;
 
 	if (!sm->gpio.registered)
 		return;
 
-	ret = gpiochip_remove(&gpio->low.gpio);
-	if (ret)
-		dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");
-
-	ret = gpiochip_remove(&gpio->high.gpio);
-	if (ret)
-		dev_err(sm->dev, "cannot remove high chip, cannot tidy up\n");
+	gpiochip_remove(&gpio->low.gpio);
+	gpiochip_remove(&gpio->high.gpio);
 
 	iounmap(gpio->regs);
 	release_resource(gpio->regs_res);
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index 11c19e5..4fac16b 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -607,7 +607,7 @@ static int tc6393xb_probe(struct platform_device *dev)
 	struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
 	struct tc6393xb *tc6393xb;
 	struct resource *iomem, *rscr;
-	int ret, temp;
+	int ret;
 
 	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	if (!iomem)
@@ -714,7 +714,7 @@ err_setup:
 
 err_gpio_add:
 	if (tc6393xb->gpio.base != -1)
-		temp = gpiochip_remove(&tc6393xb->gpio);
+		gpiochip_remove(&tc6393xb->gpio);
 	tcpd->disable(dev);
 err_enable:
 	clk_disable(tc6393xb->clk);
@@ -744,13 +744,8 @@ static int tc6393xb_remove(struct platform_device *dev)
 
 	tc6393xb_detach_irq(dev);
 
-	if (tc6393xb->gpio.base != -1) {
-		ret = gpiochip_remove(&tc6393xb->gpio);
-		if (ret) {
-			dev_err(&dev->dev, "Can't remove gpio chip: %d\n", ret);
-			return ret;
-		}
-	}
+	if (tc6393xb->gpio.base != -1)
+		gpiochip_remove(&tc6393xb->gpio);
 
 	ret = tcpd->disable(dev);
 	clk_disable(tc6393xb->clk);
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 153d595..58ea9fd 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -621,7 +621,6 @@ static void ucb1x00_remove(struct mcp *mcp)
 	struct ucb1x00_plat_data *pdata = mcp->attached_device.platform_data;
 	struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
 	struct list_head *l, *n;
-	int ret;
 
 	mutex_lock(&ucb1x00_mutex);
 	list_del(&ucb->node);
@@ -631,11 +630,8 @@ static void ucb1x00_remove(struct mcp *mcp)
 	}
 	mutex_unlock(&ucb1x00_mutex);
 
-	if (ucb->gpio.base != -1) {
-		ret = gpiochip_remove(&ucb->gpio);
-		if (ret)
-			dev_err(&ucb->dev, "Can't remove gpio chip: %d\n", ret);
-	}
+	if (ucb->gpio.base != -1)
+		gpiochip_remove(&ucb->gpio);
 
 	irq_set_chained_handler(ucb->irq, NULL);
 	irq_free_descs(ucb->irq_base, 16);
-- 
1.7.9.5


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

* Re: [PATCH 1/2] gpio: remove remaining users of gpiochip_remove() retval
  2014-09-30 14:15 [PATCH 1/2] gpio: remove remaining users of gpiochip_remove() retval Pramod Gurav
  2014-09-30 14:15 ` [PATCH 2/2] mfd: remove use " Pramod Gurav
@ 2014-10-01  7:43 ` Linus Walleij
  2014-10-01  7:52   ` Pramod Gurav
  1 sibling, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2014-10-01  7:43 UTC (permalink / raw)
  To: Pramod Gurav; +Cc: linux-kernel, Alexandre Courbot, linux-gpio

On Tue, Sep 30, 2014 at 4:15 PM, Pramod Gurav
<pramod.gurav@smartplayin.com> wrote:

> Some driver in gpio still check for return value from gpiochip_remove
> Get rid of the check for return value.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: linux-gpio@vger.kernel.org
>
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>

This is already fixed in the GPIO tree, and in linux-next.

I have got more patches like this from other people, and cannot
quite understand what kind of tree you are actually looking at?

Yours,
Linus Walleij

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

* Re: [PATCH 2/2] mfd: remove use of gpiochip_remove() retval
  2014-09-30 14:15 ` [PATCH 2/2] mfd: remove use " Pramod Gurav
@ 2014-10-01  7:45   ` Linus Walleij
  2014-10-07  9:14     ` Lee Jones
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2014-10-01  7:45 UTC (permalink / raw)
  To: Pramod Gurav
  Cc: linux-kernel, Alexandre Courbot, Samuel Ortiz, Lee Jones, linux-gpio

On Tue, Sep 30, 2014 at 4:15 PM, Pramod Gurav
<pramod.gurav@smartplayin.com> wrote:

> Get rid of using return value from gpiochip_remove() as it returns
> void.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> CC: Lee Jones <lee.jones@linaro.org>
> Cc: linux-gpio@vger.kernel.org
>
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>

Already fixed in the GPIO tree.

Yours,
Linus Walleij

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

* Re: [PATCH 1/2] gpio: remove remaining users of gpiochip_remove() retval
  2014-10-01  7:43 ` [PATCH 1/2] gpio: remove remaining users " Linus Walleij
@ 2014-10-01  7:52   ` Pramod Gurav
  0 siblings, 0 replies; 8+ messages in thread
From: Pramod Gurav @ 2014-10-01  7:52 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, Alexandre Courbot, linux-gpio

On Wednesday 01 October 2014 01:13 PM, Linus Walleij wrote:
> On Tue, Sep 30, 2014 at 4:15 PM, Pramod Gurav
> <pramod.gurav@smartplayin.com> wrote:
> 
>> Some driver in gpio still check for return value from gpiochip_remove
>> Get rid of the check for return value.
>>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Alexandre Courbot <gnurou@gmail.com>
>> Cc: linux-gpio@vger.kernel.org
>>
>> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> 
> This is already fixed in the GPIO tree, and in linux-next.
> 
> I have got more patches like this from other people, and cannot
> quite understand what kind of tree you are actually looking at?
> 
Sorry for this Linus. I have applied these patches on linux-next's
3.17-rc6. Just checked the other patch fixing these have come after rc6.
Should have done on master or gpio tree master.

Will be more careful next time.

> Yours,
> Linus Walleij
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

* Re: [PATCH 2/2] mfd: remove use of gpiochip_remove() retval
  2014-10-01  7:45   ` Linus Walleij
@ 2014-10-07  9:14     ` Lee Jones
  2014-10-07  9:19       ` Linus Walleij
  0 siblings, 1 reply; 8+ messages in thread
From: Lee Jones @ 2014-10-07  9:14 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Pramod Gurav, linux-kernel, Alexandre Courbot, Samuel Ortiz, linux-gpio

On Wed, 01 Oct 2014, Linus Walleij wrote:

> On Tue, Sep 30, 2014 at 4:15 PM, Pramod Gurav
> <pramod.gurav@smartplayin.com> wrote:
> 
> > Get rid of using return value from gpiochip_remove() as it returns
> > void.
> >
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Alexandre Courbot <gnurou@gmail.com>
> > Cc: Samuel Ortiz <sameo@linux.intel.com>
> > CC: Lee Jones <lee.jones@linaro.org>
> > Cc: linux-gpio@vger.kernel.org
> >
> > Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> 
> Already fixed in the GPIO tree.

What does that mean?  That it doesn't need fixing here?

If this patch still needs applying it will carry more weight with your
Ack.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 2/2] mfd: remove use of gpiochip_remove() retval
  2014-10-07  9:14     ` Lee Jones
@ 2014-10-07  9:19       ` Linus Walleij
  2014-10-07 10:02         ` Lee Jones
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2014-10-07  9:19 UTC (permalink / raw)
  To: Lee Jones
  Cc: Pramod Gurav, linux-kernel, Alexandre Courbot, Samuel Ortiz, linux-gpio

On Tue, Oct 7, 2014 at 11:14 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Wed, 01 Oct 2014, Linus Walleij wrote:
>
>> On Tue, Sep 30, 2014 at 4:15 PM, Pramod Gurav
>> <pramod.gurav@smartplayin.com> wrote:
>>
>> > Get rid of using return value from gpiochip_remove() as it returns
>> > void.
>> >
>> > Cc: Linus Walleij <linus.walleij@linaro.org>
>> > Cc: Alexandre Courbot <gnurou@gmail.com>
>> > Cc: Samuel Ortiz <sameo@linux.intel.com>
>> > CC: Lee Jones <lee.jones@linaro.org>
>> > Cc: linux-gpio@vger.kernel.org
>> >
>> > Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
>>
>> Already fixed in the GPIO tree.
>
> What does that mean?  That it doesn't need fixing here?

No. I think you already ACKed the patch fixing it in the GPIO
tree...

There has been some misunderstanding and duplicate patches
fixing already fixed problems are flying around.

Yours,
Linus Walleij

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

* Re: [PATCH 2/2] mfd: remove use of gpiochip_remove() retval
  2014-10-07  9:19       ` Linus Walleij
@ 2014-10-07 10:02         ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2014-10-07 10:02 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Pramod Gurav, linux-kernel, Alexandre Courbot, Samuel Ortiz, linux-gpio

On Tue, 07 Oct 2014, Linus Walleij wrote:

> On Tue, Oct 7, 2014 at 11:14 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > On Wed, 01 Oct 2014, Linus Walleij wrote:
> >
> >> On Tue, Sep 30, 2014 at 4:15 PM, Pramod Gurav
> >> <pramod.gurav@smartplayin.com> wrote:
> >>
> >> > Get rid of using return value from gpiochip_remove() as it returns
> >> > void.
> >> >
> >> > Cc: Linus Walleij <linus.walleij@linaro.org>
> >> > Cc: Alexandre Courbot <gnurou@gmail.com>
> >> > Cc: Samuel Ortiz <sameo@linux.intel.com>
> >> > CC: Lee Jones <lee.jones@linaro.org>
> >> > Cc: linux-gpio@vger.kernel.org
> >> >
> >> > Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> >>
> >> Already fixed in the GPIO tree.
> >
> > What does that mean?  That it doesn't need fixing here?
> 
> No. I think you already ACKed the patch fixing it in the GPIO
> tree...

No I don't need to apply the patch 'cos it's already fixed? Or, no
it's not already fixed and I need to apply the patch?

> There has been some misunderstanding and duplicate patches
> fixing already fixed problems are flying around.

I'm guessing from this commend that it _is_ already fixed and I _do
not_ need to apply this patch.

So for now I'm not applying this patch unless told otherwise.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2014-10-07 10:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-30 14:15 [PATCH 1/2] gpio: remove remaining users of gpiochip_remove() retval Pramod Gurav
2014-09-30 14:15 ` [PATCH 2/2] mfd: remove use " Pramod Gurav
2014-10-01  7:45   ` Linus Walleij
2014-10-07  9:14     ` Lee Jones
2014-10-07  9:19       ` Linus Walleij
2014-10-07 10:02         ` Lee Jones
2014-10-01  7:43 ` [PATCH 1/2] gpio: remove remaining users " Linus Walleij
2014-10-01  7:52   ` Pramod Gurav

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).