Skip to content

Commit

Permalink
gpio: twl4030: Reorder functions which allows to drop a forward decla…
Browse files Browse the repository at this point in the history
…raion

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 <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
  • Loading branch information
Uwe Kleine-König authored and brgl committed Sep 20, 2022
1 parent 8b10ca2 commit 9714791
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions drivers/gpio/gpio-twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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", },
{ },
Expand Down

0 comments on commit 9714791

Please sign in to comment.