lkml.org 
[lkml]   [2021]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] gpio: tegra186: Add ACPI support
On Thu, Jun 17, 2021 at 1:18 PM Akhil R <akhilrajeev@nvidia.com> wrote:
>
> From: Akhil Rajeev <akhilrajeev@nvidia.com>
>
> 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

\
 
 \ /
  Last update: 2021-06-17 17:22    [W:0.189 / U:24.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site