summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorVadim Pasternak <vadimp@mellanox.com>2018-01-31 21:55:13 +0000
committerDarren Hart (VMware) <dvhart@infradead.org>2018-01-31 12:54:56 -0800
commit4726098bcc4cf033dd57b6310de46ef3692debf5 (patch)
treeb831edb83e7bf88206d22ae3556c18b75c260c1f /drivers/platform
parent580d834fe166c695f37c942e9cd92d1743bdc5d4 (diff)
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: Vadim Pasternak <vadimp@mellanox.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/mlx-platform.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 752476e83da4..dfecba4407ac 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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]);