lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Jun 2021 18:21:38 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Akhil R <akhilrajeev@...dia.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        linux-tegra@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Mikko Perttunen <mperttunen@...dia.com>,
        Laxman Dewangan <ldewangan@...dia.com>,
        Suresh Mangipudi <smangipudi@...dia.com>,
        Krishna Yarlagadda <kyarlagadda@...dia.com>
Subject: Re: [PATCH] gpio: tegra186: Add ACPI support

On Thu, Jun 17, 2021 at 1:18 PM Akhil R <akhilrajeev@...dia.com> wrote:
>
> From: Akhil Rajeev <akhilrajeev@...dia.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ