From: Felix Gu <ustc.gu@gmail.com>
To: Conor Dooley <conor.dooley@microchip.com>,
Daire McNamara <daire.mcnamara@microchip.com>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH 2/2] soc: microchip: mpfs-mss-top-sysreg: Fix resource leak on driver unbind
Date: Mon, 09 Mar 2026 20:16:15 +0800 [thread overview]
Message-ID: <20260309-mpfs-v1-2-0dd89f34f962@gmail.com> (raw)
In-Reply-To: <20260309-mpfs-v1-0-0dd89f34f962@gmail.com>
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
next prev parent reply other threads:[~2026-03-09 12:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-03-09 17:05 ` [PATCH 0/2] soc: microchip: mpfs: " Conor Dooley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260309-mpfs-v1-2-0dd89f34f962@gmail.com \
--to=ustc.gu@gmail.com \
--cc=conor.dooley@microchip.com \
--cc=daire.mcnamara@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox