Re: [PATCH] gpio: tegra186: Add ACPI support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 17, 2021 at 1:18 PM Akhil R <akhilrajeev@xxxxxxxxxx> wrote:
>
> From: Akhil Rajeev <akhilrajeev@xxxxxxxxxx>
>
> Add ACPI module ID to probe the driver from the ACPI based bootloader
> firmware.

...

> +#include <linux/acpi.h>

It probably should be property.h, see below.

...

> +       if (has_acpi_companion(&pdev->dev)) {
> +               gpio->secure = devm_platform_ioremap_resource(pdev, 0);
> +               gpio->base = devm_platform_ioremap_resource(pdev, 1);
> +       } else {
> +               gpio->secure = devm_platform_ioremap_resource_byname(pdev, "security");
> +               gpio->base = devm_platform_ioremap_resource_byname(pdev, "gpio");
> +       }

General comment here.
Can't we rather try named resources first and fallback to indexed
ones? (Or other way around)

In this case you don't need to check for ACPI at all.

...

> +               .acpi_match_table = ACPI_PTR(tegra186_gpio_acpi_match),

You can drop ACPI_PTR() along with ugly ifdeffery.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux