Thread (1 message) flat view 1 message, 1 author, 2013-08-28

Re: [PATCH v4 1/3] ARM: bcm281xx: Add GPIO driver

From: Linus Walleij <hidden>
Date: 2013-08-28 19:50:09
Also in: linux-arm-kernel

On Fri, Aug 23, 2013 at 9:30 PM, Markus Mayer [off-list ref] wrote:
I have a follow-up question regarding status reads for each iteration.
Is this what you are looking for?

        for (;;) {
                sta = readl(reg_base + GPIO_INT_STATUS(bank_id)) &
                    (~(readl(reg_base + GPIO_INT_MASK(bank_id))));
                if (sta == 0)
                        break;
Yes, but follow the design pattern of other drivers such as the
drivers/irqchip/irq-vic.c:

static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
{
        u32 stat, irq;
        int handled = 0;

        while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
                irq = ffs(stat) - 1;
                handle_IRQ(irq_find_mapping(vic->domain, irq), regs);
                handled = 1;
        }
}

I.e use that nice while-construction.

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help