2022-06-01 19:57:17

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 0/4] mfd: Some preparations for making platform remove callbacks return void

Hello,

this is a collection of cleanups that prepare making platform device
remove callback return void.

Note there is an interdependency between patches #2 and #3 as
arch/arm/mach-pxa/eseries.c uses a single function as disable callback
for both tc6387xb and tc6393xb. (That might be a bug, I didn't check.)

Patch #2 might be stable material.

Best regards
Uwe

Uwe Kleine-König (4):
mfd: asic3: Make asic3_gpio_remove() return void
mfd: t7l66xb: Drop platform disable callback
mfd: tc6387xb: Drop disable callback that is never called
mfd: tc6393xb: Make disable callback return void

arch/arm/mach-pxa/eseries.c | 4 +---
arch/arm/mach-pxa/tosa.c | 4 +---
drivers/mfd/asic3.c | 9 +++------
drivers/mfd/t7l66xb.c | 6 +-----
drivers/mfd/tc6393xb.c | 5 ++---
include/linux/mfd/t7l66xb.h | 1 -
include/linux/mfd/tc6387xb.h | 1 -
include/linux/mfd/tc6393xb.h | 2 +-
8 files changed, 9 insertions(+), 23 deletions(-)


base-commit: 4b0986a3613c92f4ec1bdc7f60ec66fea135991f
--
2.36.1



2022-06-01 20:24:54

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback

None of the in-tree instantiations of struct t7l66xb_platform_data
provides a disable callback. So better don't dereference this function
pointer unconditionally. As there is no user, drop it completely instead
of calling it conditional.

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

Fixes: 1f192015ca5b ("mfd: driver for the T7L66XB TMIO SoC")
Signed-off-by: Uwe Kleine-König <[email protected]>
---
Technically this fixes the first commit introducing a struct
t7l66xb_platform_data without a disable callback, but ...
---
drivers/mfd/t7l66xb.c | 6 +-----
include/linux/mfd/t7l66xb.h | 1 -
2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index 5369c67e3280..663ffd4b8570 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -397,11 +397,8 @@ static int t7l66xb_probe(struct platform_device *dev)

static int t7l66xb_remove(struct platform_device *dev)
{
- struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
- int ret;

- ret = pdata->disable(dev);
clk_disable_unprepare(t7l66xb->clk48m);
clk_put(t7l66xb->clk48m);
clk_disable_unprepare(t7l66xb->clk32k);
@@ -412,8 +409,7 @@ static int t7l66xb_remove(struct platform_device *dev)
mfd_remove_devices(&dev->dev);
kfree(t7l66xb);

- return ret;
-
+ return 0;
}

static struct platform_driver t7l66xb_platform_driver = {
diff --git a/include/linux/mfd/t7l66xb.h b/include/linux/mfd/t7l66xb.h
index 69632c1b07bd..ae3e7a5c5219 100644
--- a/include/linux/mfd/t7l66xb.h
+++ b/include/linux/mfd/t7l66xb.h
@@ -12,7 +12,6 @@

struct t7l66xb_platform_data {
int (*enable)(struct platform_device *dev);
- int (*disable)(struct platform_device *dev);
int (*suspend)(struct platform_device *dev);
int (*resume)(struct platform_device *dev);

--
2.36.1


2022-06-15 21:21:16

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback

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

> None of the in-tree instantiations of struct t7l66xb_platform_data
> provides a disable callback. So better don't dereference this function
> pointer unconditionally. As there is no user, drop it completely instead
> of calling it conditional.
>
> This is a preparation for making platform remove callbacks return void.
>
> Fixes: 1f192015ca5b ("mfd: driver for the T7L66XB TMIO SoC")
> Signed-off-by: Uwe Kleine-König <[email protected]>
> ---
> Technically this fixes the first commit introducing a struct
> t7l66xb_platform_data without a disable callback, but ...
> ---
> drivers/mfd/t7l66xb.c | 6 +-----
> include/linux/mfd/t7l66xb.h | 1 -
> 2 files changed, 1 insertion(+), 6 deletions(-)

Applied, thanks.

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