soc: microchip: mpfs: Fix resource leak on driver unbind
Subsystems (3)
cover soc: microchip: mpfs: Fix resource leak on driver unbind
---
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,
Signature · 1 line
Felix Gu <[email protected]>
PATCH 1/2 soc: microchip: mpfs-control-scb: Fix resource leak on driver unbind
Use devm_mfd_add_devices() instead of mfd_add_devices() to ensure child devices are properly removed when the driver unbinds.
--- drivers/soc/microchip/mpfs-control-scb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/soc/microchip/mpfs-control-scb.c +4 -2
@@ -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[] = {
Signature · 1 line
2.43.0
PATCH 2/2 soc: microchip: mpfs-mss-top-sysreg: Fix resource leak on driver unbind
In reply to Felix GuUse devm_mfd_add_devices() instead of mfd_add_devices() to ensure child devices are properly removed when the driver unbinds.
--- drivers/soc/microchip/mpfs-mss-top-sysreg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/soc/microchip/mpfs-mss-top-sysreg.c +4 -2
@@ -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;
Signature · 1 line
2.43.0
From: Conor Dooley <[email protected]>
Quoted 1 line · Felix Gu
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.