From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keerthy Subject: Re: [PATCH 2/2] gpio: davinci: Fix the number of controllers allocated Date: Mon, 8 Feb 2016 15:17:46 +0530 Message-ID: <56B86442.4030301@ti.com> References: <1453988331-17111-1-git-send-email-j-keerthy@ti.com> <1453988331-17111-3-git-send-email-j-keerthy@ti.com> <56AA234C.4010707@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56AA234C.4010707@ti.com> Sender: linux-kernel-owner@vger.kernel.org To: Grygorii Strashko , Keerthy , linus.walleij@linaro.org, gnurou@gmail.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, lokeshvutla@ti.com, Santosh Shilimkar , Sekhar Nori List-Id: linux-gpio@vger.kernel.org On Thursday 28 January 2016 07:48 PM, Grygorii Strashko wrote: > On 01/28/2016 03:38 PM, Keerthy wrote: >> From: Lokesh Vutla >> >> Driver only needs to allocate for [ngpio / 32] controllers, >> as each controller handles 32 gpios. But the current driver >> allocates for ngpio of which the extra allocated are unused. >> Fix it be registering only the required number of controllers. >> >> Signed-off-by: Lokesh Vutla >> Signed-off-by: Keerthy > > Reviewed-by: Grygorii Strashko A gentle ping on this patch. Thanks Grygorii for the review. > >> --- >> drivers/gpio/gpio-davinci.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c >> index c889f31..cd007a6 100644 >> --- a/drivers/gpio/gpio-davinci.c >> +++ b/drivers/gpio/gpio-davinci.c >> @@ -195,7 +195,7 @@ static int davinci_gpio_of_xlate(struct gpio_chip >> *gc, >> static int davinci_gpio_probe(struct platform_device *pdev) >> { >> int i, base; >> - unsigned ngpio; >> + unsigned ngpio, nbank; >> struct davinci_gpio_controller *chips; >> struct davinci_gpio_platform_data *pdata; >> struct davinci_gpio_regs __iomem *regs; >> @@ -224,8 +224,9 @@ static int davinci_gpio_probe(struct >> platform_device *pdev) >> if (WARN_ON(ARCH_NR_GPIOS < ngpio)) >> ngpio = ARCH_NR_GPIOS; >> >> + nbank = DIV_ROUND_UP(ngpio, 32); >> chips = devm_kzalloc(dev, >> - ngpio * sizeof(struct davinci_gpio_controller), >> + nbank * sizeof(struct davinci_gpio_controller), >> GFP_KERNEL); >> if (!chips) >> return -ENOMEM; >> > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbcBHJr7 (ORCPT ); Mon, 8 Feb 2016 04:47:59 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:34341 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbcBHJry (ORCPT ); Mon, 8 Feb 2016 04:47:54 -0500 Subject: Re: [PATCH 2/2] gpio: davinci: Fix the number of controllers allocated To: Grygorii Strashko , Keerthy , , References: <1453988331-17111-1-git-send-email-j-keerthy@ti.com> <1453988331-17111-3-git-send-email-j-keerthy@ti.com> <56AA234C.4010707@ti.com> CC: , , , Santosh Shilimkar , Sekhar Nori From: Keerthy Message-ID: <56B86442.4030301@ti.com> Date: Mon, 8 Feb 2016 15:17:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <56AA234C.4010707@ti.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 28 January 2016 07:48 PM, Grygorii Strashko wrote: > On 01/28/2016 03:38 PM, Keerthy wrote: >> From: Lokesh Vutla >> >> Driver only needs to allocate for [ngpio / 32] controllers, >> as each controller handles 32 gpios. But the current driver >> allocates for ngpio of which the extra allocated are unused. >> Fix it be registering only the required number of controllers. >> >> Signed-off-by: Lokesh Vutla >> Signed-off-by: Keerthy > > Reviewed-by: Grygorii Strashko A gentle ping on this patch. Thanks Grygorii for the review. > >> --- >> drivers/gpio/gpio-davinci.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c >> index c889f31..cd007a6 100644 >> --- a/drivers/gpio/gpio-davinci.c >> +++ b/drivers/gpio/gpio-davinci.c >> @@ -195,7 +195,7 @@ static int davinci_gpio_of_xlate(struct gpio_chip >> *gc, >> static int davinci_gpio_probe(struct platform_device *pdev) >> { >> int i, base; >> - unsigned ngpio; >> + unsigned ngpio, nbank; >> struct davinci_gpio_controller *chips; >> struct davinci_gpio_platform_data *pdata; >> struct davinci_gpio_regs __iomem *regs; >> @@ -224,8 +224,9 @@ static int davinci_gpio_probe(struct >> platform_device *pdev) >> if (WARN_ON(ARCH_NR_GPIOS < ngpio)) >> ngpio = ARCH_NR_GPIOS; >> >> + nbank = DIV_ROUND_UP(ngpio, 32); >> chips = devm_kzalloc(dev, >> - ngpio * sizeof(struct davinci_gpio_controller), >> + nbank * sizeof(struct davinci_gpio_controller), >> GFP_KERNEL); >> if (!chips) >> return -ENOMEM; >> > >