[PATCH v5 5/9] ARM: versatile: Map local timers using Device Tree when possible

Pawel Moll pawel.moll at arm.com
Mon Dec 12 06:29:20 EST 2011


On Mon, 2011-12-12 at 11:18 +0000, Sergei Shtylyov wrote:
>     I think if of_iomap() fails, it's because the system is out of memory, so 
> -ENOMEM seems more proper error in this case. Although... it's not the only 
> case when of_iomap() fails.

I actually think that in this use case it's much more likely that
of_iomap() returns NULL because of_address_to_resource() fails:

void __iomem *of_iomap(struct device_node *np, int index)
{       
        struct resource res;
        
        if (of_address_to_resource(np, index, &res))
                return NULL;

and this will - again most likely - happen when np == NULL (so
of_find_compatible_node() returns nothing). That's what makes ENXIO look
good to me there...

Cheers!

Paweł





More information about the linux-arm-kernel mailing list