Skip to content

Commit f0b2731

Browse files
committed
gpio-amdpt: ACPI: Use the ACPI_COMPANION() macro directly
The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION() macro and the ACPI handle produced by the former comes from the ACPI device object produced by the latter, so it is way more straightforward to evaluate the latter directly instead of passing the handle produced by the former to acpi_bus_get_device(). Modify pt_gpio_probe() accordingly (no intentional functional impact). Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Bartosz Golaszewski <[email protected]>
1 parent ae364fd commit f0b2731

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/gpio/gpio-amdpt.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,10 @@ static void pt_gpio_free(struct gpio_chip *gc, unsigned offset)
7272
static int pt_gpio_probe(struct platform_device *pdev)
7373
{
7474
struct device *dev = &pdev->dev;
75-
struct acpi_device *acpi_dev;
76-
acpi_handle handle = ACPI_HANDLE(dev);
7775
struct pt_gpio_chip *pt_gpio;
7876
int ret = 0;
7977

80-
if (acpi_bus_get_device(handle, &acpi_dev)) {
78+
if (!ACPI_COMPANION(dev)) {
8179
dev_err(dev, "PT GPIO device node not found\n");
8280
return -ENODEV;
8381
}

0 commit comments

Comments
 (0)