Re: [PATCH][MIPS]: AR7 GPIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 12 Jan 2008 18:18:02 +0100, Matteo Croce <technoboy85@xxxxxxxxx> wrote:
> This new patch caches addresses as suggested by Atsushi Nemoto

Well, I cannot remember any suggestion about caches.  I just said you
should kill all volatiles.

> +static inline int gpio_get_value(unsigned gpio)
> +{
> +	static unsigned addr;
> +
> +	if (!addr) {
> +		void __iomem *gpio_in = (void __iomem *)
> +				KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT);
> +		addr = readl(gpio_in);
> +	}
> +
> +	return addr & (1 << gpio);
> +}

Anyway, this is absolutely broken.  You are caching the GPIO value,
not the address.

---
Atsushi Nemoto


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux