Commit 27459f86 authored by Felix Gu's avatar Felix Gu Committed by Conor Dooley
Browse files

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: 4aac11c9 ("soc: microchip: add mfd drivers for two syscon regions on PolarFire SoC")
Signed-off-by: default avatarFelix Gu <ustc.gu@gmail.com>
Signed-off-by: default avatarConor Dooley <conor.dooley@microchip.com>
parent 0528a348
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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[] = {