* Re: [PATCH v1 1/7] gpio-amdpt: ACPI: Use the ACPI_COMPANION() macro directly
2021-10-12 17:44 ` [PATCH v1 1/7] gpio-amdpt: ACPI: Use the ACPI_COMPANION() macro directly Rafael J. Wysocki
@ 2021-10-13 14:44 ` Bartosz Golaszewski
2021-10-13 16:06 ` [PATCH v2 " Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2021-10-13 14:44 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux ACPI, LKML, Linus Walleij, open list:GPIO SUBSYSTEM
On Tue, Oct 12, 2021 at 7:51 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>
> From: Rafael J. Wysocki <rafael@kernel.org>
>
> 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 <rafael@kernel.org>
> ---
> drivers/gpio/gpio-amdpt.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> Index: linux-pm/drivers/gpio/gpio-amdpt.c
> ===================================================================
> --- linux-pm.orig/drivers/gpio/gpio-amdpt.c
> +++ linux-pm/drivers/gpio/gpio-amdpt.c
> @@ -72,12 +72,10 @@ static void pt_gpio_free(struct gpio_chi
> static int pt_gpio_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> - struct acpi_device *acpi_dev;
> - acpi_handle handle = ACPI_HANDLE(dev);
> struct pt_gpio_chip *pt_gpio;
> int ret = 0;
>
> - if (acpi_bus_get_device(handle, &acpi_dev)) {
> + if (!ACPI_COMPANION(dev)) {
> dev_err(dev, "PT GPIO device node not found\n");
> return -ENODEV;
> }
>
>
>
Acked-by: Bartosz Golaszewski <brgl@bgdev.pl>
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v2 1/7] gpio-amdpt: ACPI: Use the ACPI_COMPANION() macro directly
2021-10-12 17:44 ` [PATCH v1 1/7] gpio-amdpt: ACPI: Use the ACPI_COMPANION() macro directly Rafael J. Wysocki
2021-10-13 14:44 ` Bartosz Golaszewski
@ 2021-10-13 16:06 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2021-10-13 16:06 UTC (permalink / raw)
To: Linux ACPI; +Cc: LKML, Linus Walleij, Bartosz Golaszewski, linux-gpio
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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 <rafael.j.wysocki@intel.com>
Acked-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
v1 -> v2:
* Resend with a different From and S-o-b address and with ACK from Bart.
No other changes.
---
drivers/gpio/gpio-amdpt.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Index: linux-pm/drivers/gpio/gpio-amdpt.c
===================================================================
--- linux-pm.orig/drivers/gpio/gpio-amdpt.c
+++ linux-pm/drivers/gpio/gpio-amdpt.c
@@ -72,12 +72,10 @@ static void pt_gpio_free(struct gpio_chi
static int pt_gpio_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct acpi_device *acpi_dev;
- acpi_handle handle = ACPI_HANDLE(dev);
struct pt_gpio_chip *pt_gpio;
int ret = 0;
- if (acpi_bus_get_device(handle, &acpi_dev)) {
+ if (!ACPI_COMPANION(dev)) {
dev_err(dev, "PT GPIO device node not found\n");
return -ENODEV;
}
^ permalink raw reply [flat|nested] 3+ messages in thread