From: Daniel Campello Date: Wed, 8 Jan 2020 16:35:20 +0000 (-0700) Subject: platform/chrome: wilco_ec: Fix unregistration order X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ffd7263e63fe80a39c1222a6d68e05095ed04d03;p=linux.git platform/chrome: wilco_ec: Fix unregistration order The unregistration should happen in the opposite order of the registration, so change it accordingly. No real issue has been noticed, but it is good practice to keep the correct unregistration order. Signed-off-by: Daniel Campello Signed-off-by: Enric Balletbo i Serra --- diff --git a/drivers/platform/chrome/wilco_ec/core.c b/drivers/platform/chrome/wilco_ec/core.c index 5210c357feefd..2d5f027d8770f 100644 --- a/drivers/platform/chrome/wilco_ec/core.c +++ b/drivers/platform/chrome/wilco_ec/core.c @@ -137,9 +137,9 @@ static int wilco_ec_remove(struct platform_device *pdev) { struct wilco_ec_device *ec = platform_get_drvdata(pdev); + platform_device_unregister(ec->telem_pdev); platform_device_unregister(ec->charger_pdev); wilco_ec_remove_sysfs(ec); - platform_device_unregister(ec->telem_pdev); platform_device_unregister(ec->rtc_pdev); if (ec->debugfs_pdev) platform_device_unregister(ec->debugfs_pdev);