From: pavel@denx.de (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5] clocksource: dw_apb_timer: Add common DTS glue for dw_apb_timer
Date: Thu, 12 Jul 2012 12:33:06 +0200 [thread overview]
Message-ID: <20120712103305.GA11798@elf.ucw.cz> (raw)
In-Reply-To: <1342041579.19608.6.camel@dinguyen-VirtualBox>
Hi!
> > > Make a common device tree glue for clocksource/dw_apb_timer.
> > > Move mach-picoxcell/time.c to be a generic device tree application
> > > of the dw_apb_timer.
> > >
> > > Configure mach-picoxcell to use the dw_apb_timer_of device tree
> > > implementation in drivers/clocksource.
> >
> > > @@ -25,11 +32,12 @@ static void timer_get_base_and_rate(struct device_node *np,
> > > if (!*base)
> > > panic("Unable to map regs for %s", np->name);
> > >
> > > - if (of_property_read_u32(np, "clock-freq", rate))
> > > - panic("No clock-freq property for %s", np->name);
> > > + if (of_property_read_u32(np, "clock-freq", rate) &&
> > > + of_property_read_u32(np, "clock-frequency", rate))
> > > + panic("No clock-frequency property for %s", np->name);
> > > }
> > >
> >
> > But this should be ||, not &&, I guess.
>
> Actually the way the code was written, it should be &&. Since
> of_property_read_u32 returns 0 for success, doing an OR will fail if 1
> of the conditions is true. We only want to fail if both conditions fail.
Oops, sorry, I was blind.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2012-07-12 10:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 20:13 [PATCH v5] clocksource: dw_apb_timer: Add common DTS glue for dw_apb_timer dinguyen at altera.com
2012-07-11 21:08 ` Pavel Machek
2012-07-11 21:19 ` Dinh Nguyen
2012-07-12 10:33 ` Pavel Machek [this message]
2012-07-11 21:10 ` Thomas Gleixner
2012-07-12 13:28 ` [ACKed PATCH] " Pavel Machek
2012-07-12 15:39 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120712103305.GA11798@elf.ucw.cz \
--to=pavel@denx.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).