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]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux