Skip to content

Commit 27459f8

Browse files
outman119ConchuOD
authored andcommitted
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: 4aac11c ("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>
1 parent 0528a34 commit 27459f8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/soc/microchip/mpfs-control-scb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ static int mpfs_control_scb_probe(struct platform_device *pdev)
1414
{
1515
struct device *dev = &pdev->dev;
1616

17-
return mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_control_scb_devs,
18-
ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0, NULL);
17+
return devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
18+
mpfs_control_scb_devs,
19+
ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0,
20+
NULL);
1921
}
2022

2123
static const struct of_device_id mpfs_control_scb_of_match[] = {

0 commit comments

Comments
 (0)