Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: merrifield: Fix build err without CONFIG_ACPI

When building CONFIG_ACPI is not set
gcc warn this:

drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
put_device(&adev->dev);
^~

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

YueHaibing and committed by
Rafael J. Wysocki
fe066621 257f9053

+7 -1
+1 -1
drivers/gpio/gpio-merrifield.c
··· 385 385 adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1); 386 386 if (adev) { 387 387 name = devm_kstrdup(priv->dev, acpi_dev_name(adev), GFP_KERNEL); 388 - put_device(&adev->dev); 388 + acpi_dev_put(adev); 389 389 } else { 390 390 name = "pinctrl-merrifield"; 391 391 }
+4
include/acpi/acpi_bus.h
··· 687 687 adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set); 688 688 } 689 689 690 + static inline void acpi_dev_put(struct acpi_device *adev) 691 + { 692 + put_device(&adev->dev); 693 + } 690 694 #else /* CONFIG_ACPI */ 691 695 692 696 static inline int register_acpi_bus_type(void *bus) { return 0; }
+2
include/linux/acpi.h
··· 675 675 return NULL; 676 676 } 677 677 678 + static inline void acpi_dev_put(struct acpi_device *adev) {} 679 + 678 680 static inline bool is_acpi_node(struct fwnode_handle *fwnode) 679 681 { 680 682 return false;