[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <144a79b3-29e9-fa46-bbb3-378a41ac8eda@xilinx.com>
Date: Tue, 5 Jan 2021 12:01:54 +0100
From: Michal Simek <michal.simek@...inx.com>
To: Syed Nayyar Waris <syednwaris@...il.com>,
<linus.walleij@...aro.org>,
Srinivas Neeli <srinivas.neeli@...inx.com>
CC: <andriy.shevchenko@...ux.intel.com>, <vilhelm.gray@...il.com>,
<michal.simek@...inx.com>, <arnd@...db.de>, <rrichter@...vell.com>,
<bgolaszewski@...libre.com>, <yamada.masahiro@...ionext.com>,
<akpm@...ux-foundation.org>, <rui.zhang@...el.com>,
<daniel.lezcano@...aro.org>, <amit.kucheria@...durent.com>,
<linux-arch@...r.kernel.org>, <linux-gpio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-pm@...r.kernel.org>
Subject: Re: [PATCH 5/5] gpio: xilinx: Add extra check if sum of widths exceed
64
On 26. 12. 20 7:45, Syed Nayyar Waris wrote:
> Add extra check to see if sum of widths does not exceed 64. If it
> exceeds then return -EINVAL alongwith appropriate error message.
>
> Cc: Michal Simek <michal.simek@...inx.com>
> Signed-off-by: Syed Nayyar Waris <syednwaris@...il.com>
> ---
> drivers/gpio/gpio-xilinx.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
> index d565fbf128b7..c9d740ac711b 100644
> --- a/drivers/gpio/gpio-xilinx.c
> +++ b/drivers/gpio/gpio-xilinx.c
> @@ -319,6 +319,12 @@ static int xgpio_probe(struct platform_device *pdev)
>
> chip->gc.base = -1;
> chip->gc.ngpio = chip->gpio_width[0] + chip->gpio_width[1];
> +
> + if (chip->gc.ngpio > 64) {
> + dev_err(&pdev->dev, "invalid configuration: number of GPIO is greater than 64");
> + return -EINVAL;
> + }
> +
> chip->gc.parent = &pdev->dev;
> chip->gc.direction_input = xgpio_dir_in;
> chip->gc.direction_output = xgpio_dir_out;
>
Acked-by: Michal Simek <michal.simek@...inx.com>
Thanks,
Michal
Powered by blists - more mailing lists