diff mbox series

[v2,01/11] ACPI / LPSS: Add guards against CONFIG_PCI

Message ID 20181222090720.19234-2-okaya@kernel.org (mailing list archive)
State Changes Requested, archived
Headers show
Series Specify CONFIG_PCI dependency explicitly | expand

Commit Message

Sinan Kaya Dec. 22, 2018, 9:07 a.m. UTC
We can now compile ACPI without PCI support. If code depends on CONFIG_PCI,
it needs to explicitly guard that piece.

Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
 drivers/acpi/acpi_lpss.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Rafael J. Wysocki Dec. 23, 2018, 9:45 p.m. UTC | #1
On Sat, Dec 22, 2018 at 6:49 PM Sinan Kaya <okaya@kernel.org> wrote:
>
> We can now compile ACPI without PCI support. If code depends on CONFIG_PCI,
> it needs to explicitly guard that piece.
>
> Signed-off-by: Sinan Kaya <okaya@kernel.org>
> ---
>  drivers/acpi/acpi_lpss.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index 5f94c35d165f..4148abcdf9ef 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -534,8 +534,11 @@ static struct device *acpi_lpss_find_device(const char *hid, const char *uid)
>         dev = bus_find_device(&platform_bus_type, NULL, &data, match_hid_uid);
>         if (dev)
>                 return dev;
> -
> +#ifdef CONFIG_PCI
>         return bus_find_device(&pci_bus_type, NULL, &data, match_hid_uid);
> +#else
> +       return NULL;
> +#endif
>  }

No.

Please make this driver depend on PCI instead.

>
>  static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle)
Sinan Kaya Dec. 23, 2018, 10:21 p.m. UTC | #2
On 12/23/2018 10:45 PM, Rafael J. Wysocki wrote:
> No.
> 
> Please make this driver depend on PCI instead.

Sure.
diff mbox series

Patch

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 5f94c35d165f..4148abcdf9ef 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -534,8 +534,11 @@  static struct device *acpi_lpss_find_device(const char *hid, const char *uid)
 	dev = bus_find_device(&platform_bus_type, NULL, &data, match_hid_uid);
 	if (dev)
 		return dev;
-
+#ifdef CONFIG_PCI
 	return bus_find_device(&pci_bus_type, NULL, &data, match_hid_uid);
+#else
+	return NULL;
+#endif
 }
 
 static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle)