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  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:   Mon, 31 Aug 2020 15:16:27 +0200
From:   Marek Szyprowski <m.szyprowski@...sung.com>
To:     Krzysztof Kozlowski <krzk@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Opasiak <k.opasiak@...sung.com>,
        Kukjin Kim <kgene@...nel.org>, netdev@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-nfc@...ts.01.org, linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org
Cc:     Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        Sylwester Nawrocki <snawrocki@...nel.org>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Inki Dae <inki.dae@...sung.com>
Subject: Re: [RFT 3/4] nfc: s3fwrn5: Remove wrong vendor prefix from GPIOs


On 29.08.2020 16:29, Krzysztof Kozlowski wrote:
> The device tree property prefix describes the vendor, which in case of
> S3FWRN5 chip is Samsung.  Therefore the "s3fwrn5" prefix for "en-gpios"
> and "fw-gpios" is not correct and should be deprecated.  Introduce
> properly named properties for these GPIOs but still support deprecated
> ones.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
Tested-by: Marek Szyprowski <m.szyprowski@...sung.com>
> ---
>   drivers/nfc/s3fwrn5/i2c.c | 20 ++++++++++++++------
>   1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c
> index b4eb926d220a..557279492503 100644
> --- a/drivers/nfc/s3fwrn5/i2c.c
> +++ b/drivers/nfc/s3fwrn5/i2c.c
> @@ -200,13 +200,21 @@ static int s3fwrn5_i2c_parse_dt(struct i2c_client *client)
>   	if (!np)
>   		return -ENODEV;
>   
> -	phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
> -	if (!gpio_is_valid(phy->gpio_en))
> -		return -ENODEV;
> +	phy->gpio_en = of_get_named_gpio(np, "en-gpios", 0);
> +	if (!gpio_is_valid(phy->gpio_en)) {
> +		/* Support also deprecated property */
> +		phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0);
> +		if (!gpio_is_valid(phy->gpio_en))
> +			return -ENODEV;
> +	}
>   
> -	phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
> -	if (!gpio_is_valid(phy->gpio_fw_wake))
> -		return -ENODEV;
> +	phy->gpio_fw_wake = of_get_named_gpio(np, "wake-gpios", 0);
> +	if (!gpio_is_valid(phy->gpio_fw_wake)) {
> +		/* Support also deprecated property */
> +		phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0);
> +		if (!gpio_is_valid(phy->gpio_fw_wake))
> +			return -ENODEV;
> +	}
>   
>   	return 0;
>   }

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

Powered by blists - more mailing lists