From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Thomas Weber <weber@corscience.de>
Cc: linux-omap@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
Russell King <linux@arm.linux.org.uk>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Daniel Morsing <daniel.morsing@gmail.com>,
charu@ti.com, sshtylyov@mvista.com
Subject: Re: [PATCHv4 3/4] OMAP3: Devkit8000: Check return value of gpio_request
Date: Wed, 19 Jan 2011 15:23:56 +0300 [thread overview]
Message-ID: <4D36D7DC.4020705@ru.mvista.com> (raw)
In-Reply-To: <1295425166-25540-4-git-send-email-weber@corscience.de>
Hello.
On 19-01-2011 11:19, Thomas Weber wrote:
> The return value of gpio_request is ignored.
> This patch adds the check of the return value of gpio_request.
> Signed-off-by: Thomas Weber<weber@corscience.de>
> ---
> arch/arm/mach-omap2/board-devkit8000.c | 16 ++++++++++++++--
> 1 files changed, 14 insertions(+), 2 deletions(-)
> diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
> index 9fb416b..4ddd81c 100644
> --- a/arch/arm/mach-omap2/board-devkit8000.c
> +++ b/arch/arm/mach-omap2/board-devkit8000.c
[...]
> @@ -244,13 +246,23 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
>
> /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
> devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
> - gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
> + ret = gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
> + if (ret < 0) {
> + printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
> + return ret;
> + }
> +
> /* Disable until needed */
> gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
>
> /* gpio + 7 is "DVI_PD" (out, active low) */
> devkit8000_dvi_device.reset_gpio = gpio + 7;
> - gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
> + ret = gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
> + if (ret < 0) {
> + printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
You forgot to call:
gpio_free(devkit8000_lcd_device.reset_gpio);
> + return ret;
> + }
> +
> /* Disable until needed */
> gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: sshtylyov@mvista.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv4 3/4] OMAP3: Devkit8000: Check return value of gpio_request
Date: Wed, 19 Jan 2011 15:23:56 +0300 [thread overview]
Message-ID: <4D36D7DC.4020705@ru.mvista.com> (raw)
In-Reply-To: <1295425166-25540-4-git-send-email-weber@corscience.de>
Hello.
On 19-01-2011 11:19, Thomas Weber wrote:
> The return value of gpio_request is ignored.
> This patch adds the check of the return value of gpio_request.
> Signed-off-by: Thomas Weber<weber@corscience.de>
> ---
> arch/arm/mach-omap2/board-devkit8000.c | 16 ++++++++++++++--
> 1 files changed, 14 insertions(+), 2 deletions(-)
> diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
> index 9fb416b..4ddd81c 100644
> --- a/arch/arm/mach-omap2/board-devkit8000.c
> +++ b/arch/arm/mach-omap2/board-devkit8000.c
[...]
> @@ -244,13 +246,23 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
>
> /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
> devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
> - gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
> + ret = gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
> + if (ret < 0) {
> + printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
> + return ret;
> + }
> +
> /* Disable until needed */
> gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
>
> /* gpio + 7 is "DVI_PD" (out, active low) */
> devkit8000_dvi_device.reset_gpio = gpio + 7;
> - gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
> + ret = gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
> + if (ret < 0) {
> + printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
You forgot to call:
gpio_free(devkit8000_lcd_device.reset_gpio);
> + return ret;
> + }
> +
> /* Disable until needed */
> gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);
WBR, Sergei
next prev parent reply other threads:[~2011-01-19 12:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 8:19 [PATCHv4 0/4] omap3: Devkit8000: misc fixes Thomas Weber
2011-01-19 8:19 ` Thomas Weber
2011-01-19 8:19 ` [PATCHv4 1/4] OMAP3: Devkit8000: Change lcd power pin Thomas Weber
2011-01-19 8:19 ` Thomas Weber
2011-01-19 8:19 ` [PATCHv4 2/4] OMAP3: Devkit8000: Fix tps65930 pullup/pulldown configuration Thomas Weber
2011-01-19 8:19 ` Thomas Weber
2011-01-19 22:21 ` Tony Lindgren
2011-01-19 22:21 ` Tony Lindgren
2011-01-20 6:56 ` Thomas Weber
2011-01-20 6:56 ` Thomas Weber
2011-01-19 8:19 ` [PATCHv4 3/4] OMAP3: Devkit8000: Check return value of gpio_request Thomas Weber
2011-01-19 8:19 ` Thomas Weber
2011-01-19 9:00 ` G, Manjunath Kondaiah
2011-01-19 9:00 ` G, Manjunath Kondaiah
2011-01-19 12:23 ` Sergei Shtylyov [this message]
2011-01-19 12:23 ` Sergei Shtylyov
2011-01-20 8:46 ` Thomas Weber
2011-01-20 8:46 ` Thomas Weber
2011-01-19 12:29 ` Daniel Morsing
2011-01-19 12:29 ` Daniel Morsing
2011-01-19 8:19 ` [PATCHv4 4/4] OMAP3: Devkit8000: Fix indentation of brace Thomas Weber
2011-01-19 8:19 ` Thomas Weber
2011-01-19 9:09 ` Varadarajan, Charulatha
2011-01-19 9:09 ` Varadarajan, Charulatha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D36D7DC.4020705@ru.mvista.com \
--to=sshtylyov@mvista.com \
--cc=charu@ti.com \
--cc=daniel.morsing@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=tony@atomide.com \
--cc=weber@corscience.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.