2022-06-01 11:08:41

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 1/4] mfd: asic3: Make asic3_gpio_remove() return void

Up to now asic3_gpio_remove() returns zero unconditionally. This makes it
easier to see in the caller that there is no error to handle.

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

Signed-off-by: Uwe Kleine-König <[email protected]>
---
Side note: asic3_mfd_probe() which is called by asic3_probe() could
return an error, but this isn't handled.
---
drivers/mfd/asic3.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 56338f9dbd0b..4fb7e35eb5ed 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -596,12 +596,11 @@ static __init int asic3_gpio_probe(struct platform_device *pdev,
return gpiochip_add_data(&asic->gpio, asic);
}

-static int asic3_gpio_remove(struct platform_device *pdev)
+static void asic3_gpio_remove(struct platform_device *pdev)
{
struct asic3 *asic = platform_get_drvdata(pdev);

gpiochip_remove(&asic->gpio);
- return 0;
}

static void asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
@@ -1030,7 +1029,6 @@ static int __init asic3_probe(struct platform_device *pdev)

static int asic3_remove(struct platform_device *pdev)
{
- int ret;
struct asic3 *asic = platform_get_drvdata(pdev);

asic3_set_register(asic, ASIC3_OFFSET(EXTCF, SELECT),
@@ -1038,9 +1036,8 @@ static int asic3_remove(struct platform_device *pdev)

asic3_mfd_remove(pdev);

- ret = asic3_gpio_remove(pdev);
- if (ret < 0)
- return ret;
+ asic3_gpio_remove(pdev);
+
asic3_irq_remove(pdev);

asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), 0);
--
2.36.1



2022-06-15 21:22:52

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/4] mfd: asic3: Make asic3_gpio_remove() return void

On Mon, 30 May 2022, Uwe Kleine-König wrote:

> Up to now asic3_gpio_remove() returns zero unconditionally. This makes it
> easier to see in the caller that there is no error to handle.
>
> This is a preparation for making platform remove callbacks return void.
>
> Signed-off-by: Uwe Kleine-König <[email protected]pengutronix.de>
> ---
> Side note: asic3_mfd_probe() which is called by asic3_probe() could
> return an error, but this isn't handled.
> ---
> drivers/mfd/asic3.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog