From: Al Stone ahs3@redhat.com
This will allow the samsung-pinctrl driver to compile properly regardless of whether or not ACPI is enabled
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/pinctrl/pinctrl-samsung.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c index 422e632..7cddb7c 100644 --- a/drivers/pinctrl/pinctrl-samsung.c +++ b/drivers/pinctrl/pinctrl-samsung.c @@ -29,7 +29,9 @@ #include <linux/irqdomain.h> #include <linux/spinlock.h> #include <linux/syscore_ops.h> +#ifdef CONFIG_ACPI #include <linux/acpi.h> +#endif
#include "core.h" #include "pinctrl-samsung.h" @@ -717,6 +719,7 @@ static int samsung_pinctrl_parse_dt(struct platform_device *pdev, return 0; }
+#ifdef CONFIG_ACPI /* parse the acpi resources for this pinctrl bank */ static acpi_status samsung_pinctrl_bank_resource(struct acpi_resource *resource, void *context) @@ -1180,6 +1183,7 @@ static struct samsung_pin_ctrl *samsung_pinctrl_get_soc_acpi_data(
return ctrl; } +#endif /* CONFIG_ACPI */
/* register the pinctrl interface with the pinctrl subsystem */ static int samsung_pinctrl_register(struct platform_device *pdev, @@ -1385,12 +1389,16 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct samsung_pin_ctrl *ctrl; struct resource *res; - struct acpi_handle *dev_handle; int ret; +#ifdef CONFIG_ACPI + struct acpi_handle *dev_handle;
dev_handle = DEVICE_ACPI_HANDLE(dev);
if (!pdev->dev.of_node && !dev_handle) { +#else + if (!pdev->dev.of_node) { +#endif dev_err(dev, "no device info available\n"); return -ENODEV; } @@ -1403,9 +1411,11 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) }
ctrl = samsung_pinctrl_get_soc_of_data(drvdata, pdev); +#ifdef CONFIG_ACPI if (!ctrl) { /* if not device tree, try ACPI */ ctrl = samsung_pinctrl_get_soc_acpi_data(drvdata, pdev); } +#endif if (!ctrl) { dev_err(&pdev->dev, "cannot retrieve device details\n"); return -EINVAL;