On Wed, Jun 04, 2008 at 01:00:19PM +0200, Leon Woestenberg wrote:
Yes, that looks rather buggy to me, and also sub-optimal to boot. The
u8 line should be changed to just 'unsigned' having the compiler truncate
to 8bit isn't useful when then used with a shift.
static inline void gpio_line_set(unsigned line, int value)
{
unsigned long flags;
unsigned regval;
local_irq_save(flags);
regval = *IXP4XX_GPIO_GPOUTR;
if (value == IXP4XX_GPIO_HIGH)
regval |= (1 << line);
else if (value == IXP4XX_GPIO_LOW)
regval &= ~(1 << line);
*IXP4XX_GPIO_GPOUTR = regval;
local_irq_restore(flags);
}
I think it depends on whether gpiolib is being used or not, there may
be some locking in there.
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
--