Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4726098b authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Darren Hart (VMware)
Browse files

platform/x86: mlx-platform: Add hotplug device unregister to error path



Add hotplug platform driver un-registration in case regmap cache
synchronization failed. In such case hotplug platform driver
registration should be rolled back.

Signed-off-by: default avatarVadim Pasternak <vadimp@mellanox.com>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent 580d834f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -550,10 +550,12 @@ static int __init mlxplat_init(void)
	regcache_mark_dirty(mlxplat_hotplug->regmap);
	err = regcache_sync(mlxplat_hotplug->regmap);
	if (err)
		goto fail_platform_mux_register;
		goto fail_platform_hotplug_register;

	return 0;

fail_platform_hotplug_register:
	platform_device_unregister(priv->pdev_hotplug);
fail_platform_mux_register:
	while (--i >= 0)
		platform_device_unregister(priv->pdev_mux[i]);