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

Pawel Moll pawel.moll at arm.com
Mon Dec 12 22:03:31 EST 2011


Morning,

On Sat, 2011-12-10 at 15:27 +0000, Sergei Shtylyov wrote:
> >   int __cpuinit local_timer_setup(struct clock_event_device *evt)
> >   {
> > +#if defined(CONFIG_OF)
> > +	if (!twd_base) {
> > +		struct device_node *np = of_find_compatible_node(NULL,
> > +				NULL, "arm,smp-twd");
> > +
> > +		twd_base = of_iomap(np, 0);
> > +		if (!twd_base)
> > +			return -ENXIO;
> 
>     -ENOMEM.

Hm. What I did simply mimics this ("arch/arm/include/asm/localtimer.h"):

#ifdef CONFIG_LOCAL_TIMERS
[...]
#else

static inline int local_timer_setup(struct clock_event_device *evt)
{
        return -ENXIO;
}

Now, I had a look at "include/asm-generic/errno-base.h":

#define ENXIO            6      /* No such device or address */
[...]
#define ENOMEM          12      /* Out of memory */

and to be honest, ENXIO makes more sense to me, but I really have no
strong feelings either way... Do you?

Thanks for your time!

Paweł




More information about the devicetree-discuss mailing list