public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/2] soc: microchip: mpfs: Fix resource leak on driver unbind
@ 2026-03-09 12:16 Felix Gu
  2026-03-09 12:16 ` [PATCH 1/2] soc: microchip: mpfs-control-scb: " Felix Gu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Felix Gu @ 2026-03-09 12:16 UTC (permalink / raw)
  To: Conor Dooley, Daire McNamara; +Cc: linux-riscv, linux-kernel, Felix Gu

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
Felix Gu (2):
      soc: microchip: mpfs-control-scb: Fix resource leak on driver unbind
      soc: microchip: mpfs-mss-top-sysreg: Fix resource leak on driver unbind

 drivers/soc/microchip/mpfs-control-scb.c    | 6 ++++--
 drivers/soc/microchip/mpfs-mss-top-sysreg.c | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
---
base-commit: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f
change-id: 20260309-mpfs-d0f8ce74b879

Best regards,
-- 
Felix Gu <ustc.gu@gmail.com>


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] soc: microchip: mpfs-control-scb: Fix resource leak on driver unbind
  2026-03-09 12:16 [PATCH 0/2] soc: microchip: mpfs: Fix resource leak on driver unbind Felix Gu
@ 2026-03-09 12:16 ` Felix Gu
  2026-03-09 12:16 ` [PATCH 2/2] soc: microchip: mpfs-mss-top-sysreg: " Felix Gu
  2026-03-09 17:05 ` [PATCH 0/2] soc: microchip: mpfs: " Conor Dooley
  2 siblings, 0 replies; 4+ messages in thread
From: Felix Gu @ 2026-03-09 12:16 UTC (permalink / raw)
  To: Conor Dooley, Daire McNamara; +Cc: linux-riscv, linux-kernel, Felix Gu

Use devm_mfd_add_devices() instead of mfd_add_devices() to ensure
child devices are properly removed when the driver unbinds.

Fixes: 4aac11c9a6e7 ("soc: microchip: add mfd drivers for two syscon regions on PolarFire SoC")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/soc/microchip/mpfs-control-scb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/microchip/mpfs-control-scb.c b/drivers/soc/microchip/mpfs-control-scb.c
index f0b84b1f49cb..8dda5704a389 100644
--- a/drivers/soc/microchip/mpfs-control-scb.c
+++ b/drivers/soc/microchip/mpfs-control-scb.c
@@ -14,8 +14,10 @@ static int mpfs_control_scb_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 
-	return mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_control_scb_devs,
-			       ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0, NULL);
+	return devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
+				    mpfs_control_scb_devs,
+				    ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0,
+				    NULL);
 }
 
 static const struct of_device_id mpfs_control_scb_of_match[] = {

-- 
2.43.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] soc: microchip: mpfs-mss-top-sysreg: Fix resource leak on driver unbind
  2026-03-09 12:16 [PATCH 0/2] soc: microchip: mpfs: Fix resource leak on driver unbind Felix Gu
  2026-03-09 12:16 ` [PATCH 1/2] soc: microchip: mpfs-control-scb: " Felix Gu
@ 2026-03-09 12:16 ` Felix Gu
  2026-03-09 17:05 ` [PATCH 0/2] soc: microchip: mpfs: " Conor Dooley
  2 siblings, 0 replies; 4+ messages in thread
From: Felix Gu @ 2026-03-09 12:16 UTC (permalink / raw)
  To: Conor Dooley, Daire McNamara; +Cc: linux-riscv, linux-kernel, Felix Gu

Use devm_mfd_add_devices() instead of mfd_add_devices() to ensure
child devices are properly removed when the driver unbinds.

Fixes: 4aac11c9a6e7 ("soc: microchip: add mfd drivers for two syscon regions on PolarFire SoC")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/soc/microchip/mpfs-mss-top-sysreg.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/microchip/mpfs-mss-top-sysreg.c b/drivers/soc/microchip/mpfs-mss-top-sysreg.c
index b2244e44ff0f..b0f42b8dd3ed 100644
--- a/drivers/soc/microchip/mpfs-mss-top-sysreg.c
+++ b/drivers/soc/microchip/mpfs-mss-top-sysreg.c
@@ -16,8 +16,10 @@ static int mpfs_mss_top_sysreg_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	int ret;
 
-	ret = mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_mss_top_sysreg_devs,
-			      ARRAY_SIZE(mpfs_mss_top_sysreg_devs) , NULL, 0, NULL);
+	ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
+				   mpfs_mss_top_sysreg_devs,
+				   ARRAY_SIZE(mpfs_mss_top_sysreg_devs), NULL,
+				   0, NULL);
 	if (ret)
 		return ret;
 

-- 
2.43.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] soc: microchip: mpfs: Fix resource leak on driver unbind
  2026-03-09 12:16 [PATCH 0/2] soc: microchip: mpfs: Fix resource leak on driver unbind Felix Gu
  2026-03-09 12:16 ` [PATCH 1/2] soc: microchip: mpfs-control-scb: " Felix Gu
  2026-03-09 12:16 ` [PATCH 2/2] soc: microchip: mpfs-mss-top-sysreg: " Felix Gu
@ 2026-03-09 17:05 ` Conor Dooley
  2 siblings, 0 replies; 4+ messages in thread
From: Conor Dooley @ 2026-03-09 17:05 UTC (permalink / raw)
  To: Daire McNamara, Felix Gu; +Cc: conor, Conor Dooley, linux-riscv, linux-kernel

From: Conor Dooley <conor.dooley@microchip.com>

On Mon, 09 Mar 2026 20:16:13 +0800, Felix Gu wrote:
> 


Applied to riscv-soc-fixes, thanks!

[1/2] soc: microchip: mpfs-control-scb: Fix resource leak on driver unbind
      https://git.kernel.org/conor/c/3d8388c2009b
[2/2] soc: microchip: mpfs-mss-top-sysreg: Fix resource leak on driver unbind
      https://git.kernel.org/conor/c/f632c4e84c8e

Thanks,
Conor.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-09 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 12:16 [PATCH 0/2] soc: microchip: mpfs: Fix resource leak on driver unbind Felix Gu
2026-03-09 12:16 ` [PATCH 1/2] soc: microchip: mpfs-control-scb: " Felix Gu
2026-03-09 12:16 ` [PATCH 2/2] soc: microchip: mpfs-mss-top-sysreg: " Felix Gu
2026-03-09 17:05 ` [PATCH 0/2] soc: microchip: mpfs: " Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox