Commit 9383f4c6 authored by Josh Cartwright's avatar Josh Cartwright Committed by Greg Kroah-Hartman

ACPI / platform: drop redundant ACPI_HANDLE check

The acpi_dev_pm_attach/_detach functions perform their own checks to
ensure the device has an ACPI companion.  It is not necessary for the
caller to do so.

This mirrors what other busses with ACPI dev PM support do (i2c, spi,
sdio).

Cc: Len Brown <lenb@kernel.org>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarJosh Cartwright <joshc@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8fa94e0
...@@ -481,11 +481,10 @@ static int platform_drv_probe(struct device *_dev) ...@@ -481,11 +481,10 @@ static int platform_drv_probe(struct device *_dev)
struct platform_device *dev = to_platform_device(_dev); struct platform_device *dev = to_platform_device(_dev);
int ret; int ret;
if (ACPI_HANDLE(_dev))
acpi_dev_pm_attach(_dev, true); acpi_dev_pm_attach(_dev, true);
ret = drv->probe(dev); ret = drv->probe(dev);
if (ret && ACPI_HANDLE(_dev)) if (ret)
acpi_dev_pm_detach(_dev, true); acpi_dev_pm_detach(_dev, true);
if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) { if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
...@@ -508,7 +507,6 @@ static int platform_drv_remove(struct device *_dev) ...@@ -508,7 +507,6 @@ static int platform_drv_remove(struct device *_dev)
int ret; int ret;
ret = drv->remove(dev); ret = drv->remove(dev);
if (ACPI_HANDLE(_dev))
acpi_dev_pm_detach(_dev, true); acpi_dev_pm_detach(_dev, true);
return ret; return ret;
...@@ -520,7 +518,6 @@ static void platform_drv_shutdown(struct device *_dev) ...@@ -520,7 +518,6 @@ static void platform_drv_shutdown(struct device *_dev)
struct platform_device *dev = to_platform_device(_dev); struct platform_device *dev = to_platform_device(_dev);
drv->shutdown(dev); drv->shutdown(dev);
if (ACPI_HANDLE(_dev))
acpi_dev_pm_detach(_dev, true); acpi_dev_pm_detach(_dev, true);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment