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.

Fixes: 4aac11c9a6 ("soc: microchip: add mfd drivers for two syscon regions on PolarFire SoC")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
This commit is contained in:
Felix Gu
2026-03-09 20:16:14 +08:00
committed by Conor Dooley
parent 0528a348b0
commit 27459f86a4

View File

@@ -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[] = {