From: Andreas Pretzsch Date: Tue, 12 Apr 2011 15:13:35 +0200 Subject: [U-Boot] [PATCH] gpio: generalize for all generic gpio providers In-Reply-To: <201104112314.20507.vapier@gentoo.org> References: <1301820218-26319-1-git-send-email-vapier@gentoo.org> <1302550457.13241.137.camel@ws-apr.office.loc> <201104112314.20507.vapier@gentoo.org> Message-ID: <1302614015.27200.2.camel@ws-apr.office.loc> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am Montag, den 11.04.2011, 23:14 -0400 schrieb Mike Frysinger: > On Monday, April 11, 2011 15:34:17 Andreas Pretzsch wrote: > > Am Sonntag, den 03.04.2011, 04:43 -0400 schrieb Mike Frysinger: > > > + return port_base + simple_strtoul(name, NULL, 10); > > > > Remark: Leads to an oom access when exceeding the processor number of > > GPIOs, e.g. PF48 on a BF561. IMHO, no problem but only a cosmetic issue, > > not worth adding an additional per-cpu check. > > In the end, no difference to other user errors like an invalid memory > > address. > > err, oom ? i guess you mean oob ? bfin> gpio input PF0 gpio: pin PF0 (gpio 0) value is 1 bfin> gpio input pf47 gpio: pin pf47 (gpio 47) value is 1 bfin> gpio input pf48 DCPLB exception outside of memory map at 0x33000000 [...] PANIC: Blackfin internal error > simple to fix by having the return of gpio_request() get checked ... Works, thanks. With "[U-Boot] [PATCH] gpio: check request result": bfin> gpio input PF0 gpio: pin PF0 (gpio 0) value is 1 bfin> gpio input pf47 gpio: pin pf47 (gpio 47) value is 1 bfin> gpio input pf48 gpio: requesting pin 48 failed bfin> -- carpe noctem engineering Ingenieurbuero fuer Hard- & Software-Entwicklung Andreas Pretzsch Dipl.-Ing. (FH) Andreas Pretzsch Tel. +49-(0)731-5521572 Hahnengasse 3 Fax: +49-(0)731-5521573 89073 Ulm, Germany email: apr at cn-eng.de