Skip to content

Commit fe06662

Browse files
YueHaibingrafaeljw
authored andcommitted
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 <[email protected]> Fixes: d00d210 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()") Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: YueHaibing <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 257f905 commit fe06662

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

drivers/gpio/gpio-merrifield.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
385385
adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1);
386386
if (adev) {
387387
name = devm_kstrdup(priv->dev, acpi_dev_name(adev), GFP_KERNEL);
388-
put_device(&adev->dev);
388+
acpi_dev_put(adev);
389389
} else {
390390
name = "pinctrl-merrifield";
391391
}

include/acpi/acpi_bus.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,10 @@ static inline bool acpi_device_can_poweroff(struct acpi_device *adev)
687687
adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set);
688688
}
689689

690+
static inline void acpi_dev_put(struct acpi_device *adev)
691+
{
692+
put_device(&adev->dev);
693+
}
690694
#else /* CONFIG_ACPI */
691695

692696
static inline int register_acpi_bus_type(void *bus) { return 0; }

include/linux/acpi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
675675
return NULL;
676676
}
677677

678+
static inline void acpi_dev_put(struct acpi_device *adev) {}
679+
678680
static inline bool is_acpi_node(struct fwnode_handle *fwnode)
679681
{
680682
return false;

0 commit comments

Comments
 (0)