From: Andy Shevchenko Date: Mon, 20 Aug 2018 13:45:41 +0000 (+0300) Subject: ACPI / glue: Split dev_is_platform() out of module for wide use X-Git-Tag: v5.4-rc1~2428^2~2^4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=719cf71cada1abc4f8727eac918b639a4a502a59;p=platform%2Fkernel%2Flinux-rpi.git ACPI / glue: Split dev_is_platform() out of module for wide use There would be useful to have in future the similar API in platform core, as we have, for example, for PCI subsystem, to check if device belongs to it. Thus, split out conditional to a macro dev_is_platform() for wide use. No functional change intended. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 3be1433..12ba2be 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -320,7 +320,7 @@ static int acpi_platform_notify(struct device *dev) if (!adev) goto out; - if (dev->bus == &platform_bus_type) + if (dev_is_platform(dev)) acpi_configure_pmsi_domain(dev); if (type && type->setup) diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 1a9f38f..c7c081d 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -40,6 +40,7 @@ struct platform_device { #define platform_get_device_id(pdev) ((pdev)->id_entry) +#define dev_is_platform(dev) ((dev)->bus == &platform_bus_type) #define to_platform_device(x) container_of((x), struct platform_device, dev) extern int platform_device_register(struct platform_device *);