mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 06:41:39 -04:00
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:
@@ -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[] = {
|
||||
|
||||
Reference in New Issue
Block a user