Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a4e86da authored by Imre Deak's avatar Imre Deak Committed by Tony Lindgren
Browse files

ARM: OMAP: GPIO: fix MPUIO check



- MPUIO doesn't exist on OMAP2
- no error was returned for too big MPUIO numbers

Signed-off-by: default avatarImre Deak <imre.deak@solidboot.com>
Signed-off-by: default avatarJuha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 0e0a1986
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -110,8 +110,6 @@
#define OMAP24XX_GPIO_CLEARDATAOUT	0x0090
#define OMAP24XX_GPIO_SETDATAOUT	0x0094

#define OMAP_MPUIO_MASK		(~OMAP_MAX_GPIO_LINES & 0xff)

struct gpio_bank {
	void __iomem *base;
	u16 irq;
@@ -216,11 +214,13 @@ static inline int gpio_valid(int gpio)
{
	if (gpio < 0)
		return -1;
#ifndef CONFIG_ARCH_OMAP24XX
	if (OMAP_GPIO_IS_MPUIO(gpio)) {
		if ((gpio & OMAP_MPUIO_MASK) > 16)
		if (gpio >= MAX_GPIO_LINES + 16)
			return -1;
		return 0;
	}
#endif
#ifdef CONFIG_ARCH_OMAP15XX
	if (cpu_is_omap15xx() && gpio < 16)
		return 0;