All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: brcmstb: Make .remove() obviously always return 0
@ 2022-06-21  6:35 ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2022-06-21  6:35 UTC (permalink / raw)
  To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski
  Cc: Broadcom internal kernel review list, linux-gpio,
	linux-arm-kernel, kernel

priv cannot be NULL because brcmstb_gpio_probe() calls
platform_set_drvdata() with a non-NULL argument, so the check for !priv can
be dropped.

Also remove the variable ret that is only used to hide a bit that in the
end zero is returned.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpio/gpio-brcmstb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index 6b7439b44690..f620f0712134 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -385,12 +385,7 @@ static int brcmstb_gpio_remove(struct platform_device *pdev)
 {
 	struct brcmstb_gpio_priv *priv = platform_get_drvdata(pdev);
 	struct brcmstb_gpio_bank *bank;
-	int offset, ret = 0, virq;
-
-	if (!priv) {
-		dev_err(&pdev->dev, "called %s without drvdata!\n", __func__);
-		return -EFAULT;
-	}
+	int offset, virq;
 
 	if (priv->parent_irq > 0)
 		irq_set_chained_handler_and_data(priv->parent_irq, NULL, NULL);
@@ -411,7 +406,7 @@ static int brcmstb_gpio_remove(struct platform_device *pdev)
 	list_for_each_entry(bank, &priv->bank_list, node)
 		gpiochip_remove(&bank->gc);
 
-	return ret;
+	return 0;
 }
 
 static int brcmstb_gpio_of_xlate(struct gpio_chip *gc,

base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
-- 
2.36.1


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

* [PATCH] gpio: brcmstb: Make .remove() obviously always return 0
@ 2022-06-21  6:35 ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2022-06-21  6:35 UTC (permalink / raw)
  To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski
  Cc: Broadcom internal kernel review list, linux-gpio,
	linux-arm-kernel, kernel

priv cannot be NULL because brcmstb_gpio_probe() calls
platform_set_drvdata() with a non-NULL argument, so the check for !priv can
be dropped.

Also remove the variable ret that is only used to hide a bit that in the
end zero is returned.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpio/gpio-brcmstb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index 6b7439b44690..f620f0712134 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -385,12 +385,7 @@ static int brcmstb_gpio_remove(struct platform_device *pdev)
 {
 	struct brcmstb_gpio_priv *priv = platform_get_drvdata(pdev);
 	struct brcmstb_gpio_bank *bank;
-	int offset, ret = 0, virq;
-
-	if (!priv) {
-		dev_err(&pdev->dev, "called %s without drvdata!\n", __func__);
-		return -EFAULT;
-	}
+	int offset, virq;
 
 	if (priv->parent_irq > 0)
 		irq_set_chained_handler_and_data(priv->parent_irq, NULL, NULL);
@@ -411,7 +406,7 @@ static int brcmstb_gpio_remove(struct platform_device *pdev)
 	list_for_each_entry(bank, &priv->bank_list, node)
 		gpiochip_remove(&bank->gc);
 
-	return ret;
+	return 0;
 }
 
 static int brcmstb_gpio_of_xlate(struct gpio_chip *gc,

base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
-- 
2.36.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] gpio: brcmstb: Make .remove() obviously always return 0
  2022-06-21  6:35 ` Uwe Kleine-König
@ 2022-06-23 21:19   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2022-06-23 21:19 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Doug Berger, Florian Fainelli, Linus Walleij,
	Broadcom internal kernel review list, open list:GPIO SUBSYSTEM,
	Linux ARM, Sascha Hauer

On Tue, Jun 21, 2022 at 8:35 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> priv cannot be NULL because brcmstb_gpio_probe() calls
> platform_set_drvdata() with a non-NULL argument, so the check for !priv can
> be dropped.
>
> Also remove the variable ret that is only used to hide a bit that in the
> end zero is returned.
>
> This is a preparation for making platform remove callbacks return void.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---

Applied, thanks!

Bart

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

* Re: [PATCH] gpio: brcmstb: Make .remove() obviously always return 0
@ 2022-06-23 21:19   ` Bartosz Golaszewski
  0 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2022-06-23 21:19 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Doug Berger, Florian Fainelli, Linus Walleij,
	Broadcom internal kernel review list, open list:GPIO SUBSYSTEM,
	Linux ARM, Sascha Hauer

On Tue, Jun 21, 2022 at 8:35 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> priv cannot be NULL because brcmstb_gpio_probe() calls
> platform_set_drvdata() with a non-NULL argument, so the check for !priv can
> be dropped.
>
> Also remove the variable ret that is only used to hide a bit that in the
> end zero is returned.
>
> This is a preparation for making platform remove callbacks return void.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---

Applied, thanks!

Bart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-06-23 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21  6:35 [PATCH] gpio: brcmstb: Make .remove() obviously always return 0 Uwe Kleine-König
2022-06-21  6:35 ` Uwe Kleine-König
2022-06-23 21:19 ` Bartosz Golaszewski
2022-06-23 21:19   ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.