linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] mfd: Some preparations for making platform remove callbacks return void
@ 2022-05-30 19:24 Uwe Kleine-König
  2022-05-30 19:24 ` [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2022-05-30 19:24 UTC (permalink / raw)
  To: Lee Jones, Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: linux-kernel, kernel, linux-arm-kernel

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


_______________________________________________
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] 9+ messages in thread

* [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback
  2022-05-30 19:24 [PATCH 0/4] mfd: Some preparations for making platform remove callbacks return void Uwe Kleine-König
@ 2022-05-30 19:24 ` Uwe Kleine-König
  2022-06-15 21:06   ` Lee Jones
  2022-05-30 19:24 ` [PATCH 3/4] mfd: tc6387xb: Drop disable callback that is never called Uwe Kleine-König
  2022-05-30 19:24 ` [PATCH 4/4] mfd: tc6393xb: Make disable callback return void Uwe Kleine-König
  2 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2022-05-30 19:24 UTC (permalink / raw)
  To: Lee Jones, Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: linux-kernel, kernel, linux-arm-kernel

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 <u.kleine-koenig@pengutronix.de>
---
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


_______________________________________________
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] 9+ messages in thread

* [PATCH 3/4] mfd: tc6387xb: Drop disable callback that is never called
  2022-05-30 19:24 [PATCH 0/4] mfd: Some preparations for making platform remove callbacks return void Uwe Kleine-König
  2022-05-30 19:24 ` [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback Uwe Kleine-König
@ 2022-05-30 19:24 ` Uwe Kleine-König
  2022-06-15 21:07   ` Lee Jones
  2022-05-30 19:24 ` [PATCH 4/4] mfd: tc6393xb: Make disable callback return void Uwe Kleine-König
  2 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2022-05-30 19:24 UTC (permalink / raw)
  To: Lee Jones, Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: linux-kernel, kernel, linux-arm-kernel

The driver never calls the disable callback, so drop the member from
the platform struct and all callbacks from the actual platform datas.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-pxa/eseries.c  | 1 -
 include/linux/mfd/tc6387xb.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index f37c44b6139d..cb7bf6294e12 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -138,7 +138,6 @@ static void __init __maybe_unused eseries_register_clks(void)
 
 static struct tc6387xb_platform_data e330_tc6387xb_info = {
 	.enable   = &eseries_tmio_enable,
-	.disable  = &eseries_tmio_disable,
 	.suspend  = &eseries_tmio_suspend,
 	.resume   = &eseries_tmio_resume,
 };
diff --git a/include/linux/mfd/tc6387xb.h b/include/linux/mfd/tc6387xb.h
index b4888209494a..aacf1dcc86b9 100644
--- a/include/linux/mfd/tc6387xb.h
+++ b/include/linux/mfd/tc6387xb.h
@@ -12,7 +12,6 @@
 
 struct tc6387xb_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


_______________________________________________
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] 9+ messages in thread

* [PATCH 4/4] mfd: tc6393xb: Make disable callback return void
  2022-05-30 19:24 [PATCH 0/4] mfd: Some preparations for making platform remove callbacks return void Uwe Kleine-König
  2022-05-30 19:24 ` [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback Uwe Kleine-König
  2022-05-30 19:24 ` [PATCH 3/4] mfd: tc6387xb: Drop disable callback that is never called Uwe Kleine-König
@ 2022-05-30 19:24 ` Uwe Kleine-König
  2022-06-15 21:08   ` Lee Jones
  2 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2022-05-30 19:24 UTC (permalink / raw)
  To: Lee Jones, Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: linux-kernel, kernel, linux-arm-kernel

All implementations return 0, so simplify accordingly.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-pxa/eseries.c  | 3 +--
 arch/arm/mach-pxa/tosa.c     | 4 +---
 drivers/mfd/tc6393xb.c       | 5 ++---
 include/linux/mfd/tc6393xb.h | 2 +-
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index cb7bf6294e12..c0b496300e3f 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -85,11 +85,10 @@ int eseries_tmio_enable(struct platform_device *dev)
 	return 0;
 }
 
-int eseries_tmio_disable(struct platform_device *dev)
+void eseries_tmio_disable(struct platform_device *dev)
 {
 	gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
 	gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
-	return 0;
 }
 
 int eseries_tmio_suspend(struct platform_device *dev)
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 431709725d02..8d97c0d74e8f 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -662,13 +662,11 @@ static int tosa_tc6393xb_enable(struct platform_device *dev)
 	return rc;
 }
 
-static int tosa_tc6393xb_disable(struct platform_device *dev)
+static void tosa_tc6393xb_disable(struct platform_device *dev)
 {
 	gpio_free(TOSA_GPIO_TC6393XB_L3V_ON);
 	gpio_free(TOSA_GPIO_TC6393XB_SUSPEND);
 	gpio_free(TOSA_GPIO_TC6393XB_REST_IN);
-
-	return 0;
 }
 
 static int tosa_tc6393xb_resume(struct platform_device *dev)
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index 3d5b14c60e20..7de210f143de 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -734,7 +734,6 @@ static int tc6393xb_remove(struct platform_device *dev)
 {
 	struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
 	struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
-	int ret;
 
 	mfd_remove_devices(&dev->dev);
 
@@ -746,14 +745,14 @@ static int tc6393xb_remove(struct platform_device *dev)
 	if (tc6393xb->gpio.base != -1)
 		gpiochip_remove(&tc6393xb->gpio);
 
-	ret = tcpd->disable(dev);
+	tcpd->disable(dev);
 	clk_disable_unprepare(tc6393xb->clk);
 	iounmap(tc6393xb->scr);
 	release_resource(&tc6393xb->rscr);
 	clk_put(tc6393xb->clk);
 	kfree(tc6393xb);
 
-	return ret;
+	return 0;
 }
 
 #ifdef CONFIG_PM
diff --git a/include/linux/mfd/tc6393xb.h b/include/linux/mfd/tc6393xb.h
index fcc8e74f0e8d..602b391ed13a 100644
--- a/include/linux/mfd/tc6393xb.h
+++ b/include/linux/mfd/tc6393xb.h
@@ -22,7 +22,7 @@ struct tc6393xb_platform_data {
 	u16	scr_gper;	/* GP Enable */
 
 	int	(*enable)(struct platform_device *dev);
-	int	(*disable)(struct platform_device *dev);
+	void	(*disable)(struct platform_device *dev);
 	int	(*suspend)(struct platform_device *dev);
 	int	(*resume)(struct platform_device *dev);
 
-- 
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] 9+ messages in thread

* Re: [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback
  2022-05-30 19:24 ` [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback Uwe Kleine-König
@ 2022-06-15 21:06   ` Lee Jones
  0 siblings, 0 replies; 9+ messages in thread
From: Lee Jones @ 2022-06-15 21:06 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, linux-kernel,
	kernel, linux-arm-kernel

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 <u.kleine-koenig@pengutronix.de>
> ---
> 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

_______________________________________________
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] 9+ messages in thread

* Re: [PATCH 3/4] mfd: tc6387xb: Drop disable callback that is never called
  2022-05-30 19:24 ` [PATCH 3/4] mfd: tc6387xb: Drop disable callback that is never called Uwe Kleine-König
@ 2022-06-15 21:07   ` Lee Jones
  2022-06-19  8:32     ` Uwe Kleine-König
  0 siblings, 1 reply; 9+ messages in thread
From: Lee Jones @ 2022-06-15 21:07 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, linux-kernel,
	kernel, linux-arm-kernel

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

> The driver never calls the disable callback, so drop the member from
> the platform struct and all callbacks from the actual platform datas.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  arch/arm/mach-pxa/eseries.c  | 1 -
>  include/linux/mfd/tc6387xb.h | 1 -
>  2 files changed, 2 deletions(-)

Applied, thanks.

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

_______________________________________________
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] 9+ messages in thread

* Re: [PATCH 4/4] mfd: tc6393xb: Make disable callback return void
  2022-05-30 19:24 ` [PATCH 4/4] mfd: tc6393xb: Make disable callback return void Uwe Kleine-König
@ 2022-06-15 21:08   ` Lee Jones
  0 siblings, 0 replies; 9+ messages in thread
From: Lee Jones @ 2022-06-15 21:08 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, linux-kernel,
	kernel, linux-arm-kernel

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

> All implementations return 0, so simplify accordingly.
> 
> This is a preparation for making platform remove callbacks return void.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  arch/arm/mach-pxa/eseries.c  | 3 +--
>  arch/arm/mach-pxa/tosa.c     | 4 +---

Needs an Arm Ack.

>  drivers/mfd/tc6393xb.c       | 5 ++---
>  include/linux/mfd/tc6393xb.h | 2 +-
>  4 files changed, 5 insertions(+), 9 deletions(-)

Doesn't apply.  Please rebase and resubmit.

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

_______________________________________________
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] 9+ messages in thread

* Re: [PATCH 3/4] mfd: tc6387xb: Drop disable callback that is never called
  2022-06-15 21:07   ` Lee Jones
@ 2022-06-19  8:32     ` Uwe Kleine-König
  2022-06-20  8:31       ` Lee Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2022-06-19  8:32 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Haojian Zhuang, Daniel Mack, kernel,
	Robert Jarzmik, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 977 bytes --]

Hello Lee,

On Wed, Jun 15, 2022 at 10:07:04PM +0100, Lee Jones wrote:
> On Mon, 30 May 2022, Uwe Kleine-König wrote:
> 
> > The driver never calls the disable callback, so drop the member from
> > the platform struct and all callbacks from the actual platform datas.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> >  arch/arm/mach-pxa/eseries.c  | 1 -
> >  include/linux/mfd/tc6387xb.h | 1 -
> >  2 files changed, 2 deletions(-)
> 
> Applied, thanks.

Are these already in a public tree? They are not in next and
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git#for-mfd-next
doesn't contain commits that are not in v5.19-rc1.

I assume they are still in an internal tree and I just need some
patience until they are pushed out?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 9+ messages in thread

* Re: [PATCH 3/4] mfd: tc6387xb: Drop disable callback that is never called
  2022-06-19  8:32     ` Uwe Kleine-König
@ 2022-06-20  8:31       ` Lee Jones
  0 siblings, 0 replies; 9+ messages in thread
From: Lee Jones @ 2022-06-20  8:31 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-kernel, Haojian Zhuang, Daniel Mack, kernel,
	Robert Jarzmik, linux-arm-kernel

On Sun, 19 Jun 2022, Uwe Kleine-König wrote:

> Hello Lee,
> 
> On Wed, Jun 15, 2022 at 10:07:04PM +0100, Lee Jones wrote:
> > On Mon, 30 May 2022, Uwe Kleine-König wrote:
> > 
> > > The driver never calls the disable callback, so drop the member from
> > > the platform struct and all callbacks from the actual platform datas.
> > > 
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > ---
> > >  arch/arm/mach-pxa/eseries.c  | 1 -
> > >  include/linux/mfd/tc6387xb.h | 1 -
> > >  2 files changed, 2 deletions(-)
> > 
> > Applied, thanks.
> 
> Are these already in a public tree? They are not in next and
> git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git#for-mfd-next
> doesn't contain commits that are not in v5.19-rc1.
> 
> I assume they are still in an internal tree and I just need some
> patience until they are pushed out?

Correct.  Patience is a virtue.

I'm back at my desk today after a week of travel.

Check -next tomorrow.

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

_______________________________________________
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] 9+ messages in thread

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 19:24 [PATCH 0/4] mfd: Some preparations for making platform remove callbacks return void Uwe Kleine-König
2022-05-30 19:24 ` [PATCH 2/4] mfd: t7l66xb: Drop platform disable callback Uwe Kleine-König
2022-06-15 21:06   ` Lee Jones
2022-05-30 19:24 ` [PATCH 3/4] mfd: tc6387xb: Drop disable callback that is never called Uwe Kleine-König
2022-06-15 21:07   ` Lee Jones
2022-06-19  8:32     ` Uwe Kleine-König
2022-06-20  8:31       ` Lee Jones
2022-05-30 19:24 ` [PATCH 4/4] mfd: tc6393xb: Make disable callback return void Uwe Kleine-König
2022-06-15 21:08   ` Lee Jones

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).