From 4b8a8385da13bd51d7403c5b08bbeab02e05c393 Mon Sep 17 00:00:00 2001 From: Khuong Dinh Date: Fri, 9 Feb 2018 17:38:34 +0200 Subject: [PATCH 07/11] BACKPORT: ACPI / bus: Remove checks in acpi_get_match_data() As well as its sibling of_device_get_match_data() has no such checks, no need to do it in acpi_get_match_data(). First of all, we are not supposed to call fwnode API like this without driver attached. Second, since __acpi_match_device() does check input parameter there is no need to duplicate it outside. And last but not least one, the API should still serve the cases when ACPI device is enumerated via PRP0001. In such case driver has neither ACPI table nor driver data there. This patch is required to support AHCI ALPM de-feature for Ampere Computing eMAG SATA. This patch is backported from: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20180913&id=8ff277c5bf87d750a44a656d4f113462493acbfc Change-Id: Id2f1d591f59af93e21741cd62c8ced0ff6a747b8 Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki Signed-off-by: Khuong Dinh --- drivers/acpi/bus.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index f87ed3b..b271eb1 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -789,12 +789,6 @@ void *acpi_get_match_data(const struct device *dev) { const struct acpi_device_id *match; - if (!dev->driver) - return NULL; - - if (!dev->driver->acpi_match_table) - return NULL; - match = acpi_match_device(dev->driver->acpi_match_table, dev); if (!match) return NULL; -- 1.8.3.1