From: dinguyen@altera.com (Dinh Nguyen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5] clocksource: dw_apb_timer: Add common DTS glue for dw_apb_timer
Date: Wed, 11 Jul 2012 16:19:39 -0500 [thread overview]
Message-ID: <1342041579.19608.6.camel@dinguyen-VirtualBox> (raw)
In-Reply-To: <20120711210837.GA32489@elf.ucw.cz>
On Wed, 2012-07-11 at 23:08 +0200, Pavel Machek wrote:
> Hi!
>
> > From: Dinh Nguyen <dinguyen@altera.com>
>
> Not that it matters, but it should probably be from: me, since I did
> the original version...
I apologize, I just took over the next day since my submission for
Altera's socfpga port is dependent on this.
>
> > 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.
Dinh
>
> Thanks for the patch,
> Pavel
>
next prev parent reply other threads:[~2012-07-11 21:19 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 [this message]
2012-07-12 10:33 ` Pavel Machek
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=1342041579.19608.6.camel@dinguyen-VirtualBox \
--to=dinguyen@altera.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.