linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
To: linux-omap@vger.kernel.org
Cc: Tony Lindgren <tony@atomide.com>,
	Syed Mohammed Khasim <khasim@ti.com>,
	Russell King <linux@arm.linux.org.uk>,
	Philip Oberstaller <philip.oberstaller@septentrio.com>,
	"Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
Subject: [PATCH] OMAP3 EVM: remove out-of-bounds array access of gpio_leds.
Date: Mon, 13 Feb 2012 09:35:22 +0100	[thread overview]
Message-ID: <1329122122-5804-1-git-send-email-arnout@mind.be> (raw)

From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>

The omap3evm BSP enables a GPIO LED on the twl4030 chip.  However,
the static gpio_leds array doesn't have an entry for it.  This is
most likely a copy-and-paste error, because it has been in there
since the first commit of the omap3evm BSP (53c5ec31).

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Please CC me, I'm not on the list.

Since I don't have access to an OMAP3EVM board or schematics, I
couldn't actually test if my fix is correct.  I discovered the error
because I'm using this BSP for an AM37xEVM board - which has the
LED connected to a different GPIO.  It works on the AM37xEVM board
if I replace the assignment with the correct GPIO number (8).
---
 arch/arm/mach-omap2/board-omap3evm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index ec00b2e..f6f5cd4 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -381,7 +381,7 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
 	gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI");
 
 	/* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
-	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+	gpio_leds[0].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
 	platform_device_register(&leds_gpio);
 
-- 
1.7.8.3


             reply	other threads:[~2012-02-13  8:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13  8:35 Arnout Vandecappelle (Essensium/Mind) [this message]
2012-02-21 22:48 ` [PATCH] OMAP3 EVM: remove out-of-bounds array access of gpio_leds Tony Lindgren

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=1329122122-5804-1-git-send-email-arnout@mind.be \
    --to=arnout@mind.be \
    --cc=khasim@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=philip.oberstaller@septentrio.com \
    --cc=tony@atomide.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).