* [PATCH] gpio: twl4030: Reorder functions which allows to drop a forward declaraion
@ 2022-09-17 21:37 Uwe Kleine-König
2022-09-18 14:17 ` Linus Walleij
2022-09-20 7:03 ` Bartosz Golaszewski
0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2022-09-17 21:37 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski; +Cc: linux-gpio, kernel
There is no cyclic dependency between gpio_twl4030_probe() and
gpio_twl4030_remove(), so by moving the latter before the former the
forward declaration can be dropped.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/gpio/gpio-twl4030.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index 5046e51af8df..c1bb2c3ca6f2 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -465,8 +465,6 @@ static int gpio_twl4030_debounce(u32 debounce, u8 mmc_cd)
REG_GPIO_DEBEN1, 3);
}
-static int gpio_twl4030_remove(struct platform_device *pdev);
-
static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev,
struct twl4030_gpio_platform_data *pdata)
{
@@ -494,6 +492,18 @@ static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev,
return omap_twl_info;
}
+/* Cannot use as gpio_twl4030_probe() calls us */
+static int gpio_twl4030_remove(struct platform_device *pdev)
+{
+ struct gpio_twl4030_priv *priv = platform_get_drvdata(pdev);
+
+ gpiochip_remove(&priv->gpio_chip);
+
+ /* REVISIT no support yet for deregistering all the IRQs */
+ WARN_ON(!is_module());
+ return 0;
+}
+
static int gpio_twl4030_probe(struct platform_device *pdev)
{
struct twl4030_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
@@ -590,18 +600,6 @@ static int gpio_twl4030_probe(struct platform_device *pdev)
return ret;
}
-/* Cannot use as gpio_twl4030_probe() calls us */
-static int gpio_twl4030_remove(struct platform_device *pdev)
-{
- struct gpio_twl4030_priv *priv = platform_get_drvdata(pdev);
-
- gpiochip_remove(&priv->gpio_chip);
-
- /* REVISIT no support yet for deregistering all the IRQs */
- WARN_ON(!is_module());
- return 0;
-}
-
static const struct of_device_id twl_gpio_match[] = {
{ .compatible = "ti,twl4030-gpio", },
{ },
--
2.37.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: twl4030: Reorder functions which allows to drop a forward declaraion
2022-09-17 21:37 [PATCH] gpio: twl4030: Reorder functions which allows to drop a forward declaraion Uwe Kleine-König
@ 2022-09-18 14:17 ` Linus Walleij
2022-09-20 7:03 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2022-09-18 14:17 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Bartosz Golaszewski, linux-gpio, kernel
On Sat, Sep 17, 2022 at 11:38 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> There is no cyclic dependency between gpio_twl4030_probe() and
> gpio_twl4030_remove(), so by moving the latter before the former the
> forward declaration can be dropped.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: twl4030: Reorder functions which allows to drop a forward declaraion
2022-09-17 21:37 [PATCH] gpio: twl4030: Reorder functions which allows to drop a forward declaraion Uwe Kleine-König
2022-09-18 14:17 ` Linus Walleij
@ 2022-09-20 7:03 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2022-09-20 7:03 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Linus Walleij, linux-gpio, kernel
On Sat, Sep 17, 2022 at 11:38 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> There is no cyclic dependency between gpio_twl4030_probe() and
> gpio_twl4030_remove(), so by moving the latter before the former the
> forward declaration can be dropped.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Applied, thanks!
Bart
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-20 7:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-17 21:37 [PATCH] gpio: twl4030: Reorder functions which allows to drop a forward declaraion Uwe Kleine-König
2022-09-18 14:17 ` Linus Walleij
2022-09-20 7:03 ` Bartosz Golaszewski
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).