dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v4,2/4] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-09 15:38 Andy Shevchenko
  0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2018-02-09 15:38 UTC (permalink / raw)
  To: dmaengine, Rafael J . Wysocki, linux-acpi, Mika Westerberg
  Cc: Andy Shevchenko, Sinan Kaya, Sakari Ailus, Vinod Koul

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.

Cc: Sinan Kaya <okaya@codeaurora.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/bus.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index f1384e107eed..ca4af098b1bf 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -834,12 +834,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;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-09 15:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-09 15:38 [v4,2/4] ACPI / bus: Remove checks in acpi_get_match_data() Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).