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]
Message-ID: <AM0PR04MB448174E1DE647E9F2F65106988360@AM0PR04MB4481.eurprd04.prod.outlook.com>
Date:   Thu, 16 Jan 2020 08:28:23 +0000
From:   Peng Fan <peng.fan@....com>
To:     Peng Fan <peng.fan@....com>,
        "jason@...edaemon.net" <jason@...edaemon.net>,
        "andrew@...n.ch" <andrew@...n.ch>,
        "gregory.clement@...tlin.com" <gregory.clement@...tlin.com>,
        "sebastian.hesselbarth@...il.com" <sebastian.hesselbarth@...il.com>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "mripard@...nel.org" <mripard@...nel.org>,
        "wens@...e.org" <wens@...e.org>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
CC:     "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/2] pinctrl: mvebu: armada-37xx: use use platform api

Hi Linus,

> Subject: [PATCH 1/2] pinctrl: mvebu: armada-37xx: use use platform api

Would you pick this patch up?

Per Uwe, this v1 patch use %pe is better that v2 use %d.

Thanks,
Peng.

> 
> From: Peng Fan <peng.fan@....com>
> 
> platform_irq_count() and platform_get_irq() is the more generic way
> (independent of device trees) to determine the count of available interrupts.
> So use this instead.
> 
> As platform_irq_count() might return an error code (which of_irq_count
> doesn't) some additional handling is necessary.
> 
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
>  drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> index aa9dcde0f069..cc66a6429a06 100644
> --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> @@ -15,7 +15,6 @@
>  #include <linux/of.h>
>  #include <linux/of_address.h>
>  #include <linux/of_device.h>
> -#include <linux/of_irq.h>
>  #include <linux/pinctrl/pinconf-generic.h>  #include
> <linux/pinctrl/pinconf.h>  #include <linux/pinctrl/pinctrl.h> @@ -739,7
> +738,14 @@ static int armada_37xx_irqchip_register(struct platform_device
> *pdev,
>  		return ret;
>  	}
> 
> -	nr_irq_parent = of_irq_count(np);
> +	nr_irq_parent = platform_irq_count(pdev);
> +	if (nr_irq_parent < 0) {
> +		if (nr_irq_parent != -EPROBE_DEFER)
> +			dev_err(dev, "Couldn't determine irq count: %pe\n",
> +				ERR_PTR(nr_irq_parent));
> +		return nr_irq_parent;
> +	}
> +
>  	spin_lock_init(&info->irq_lock);
> 
>  	if (!nr_irq_parent) {
> @@ -776,7 +782,7 @@ static int armada_37xx_irqchip_register(struct
> platform_device *pdev,
>  	if (!girq->parents)
>  		return -ENOMEM;
>  	for (i = 0; i < nr_irq_parent; i++) {
> -		int irq = irq_of_parse_and_map(np, i);
> +		int irq = platform_get_irq(pdev, i);
> 
>  		if (irq < 0)
>  			continue;
> --
> 2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ