[PATCH 11/11] rtc/cmos: add OF bindings
Grant Likely
grant.likely at secretlab.ca
Wed Feb 23 07:50:48 EST 2011
On Tue, Feb 22, 2011 at 1:07 PM, Sebastian Andrzej Siewior
<bigeasy at linutronix.de> wrote:
> This allows to load the OF driver based informations from the device
> tree. Systems without BIOS may need to perform some initialization.
> PowerPC creates a PNP device from the OF information and performs this
> kind of initialization in their private PCI quirk. This looks more
> generic.
> This patch also avoids registering the platform RTC driver on X86 if we
> have a device tree blob. Without it we end up with of this devices. It
> is in this hunk in order to remain bisectable.
>
> Cc: rtc-linux at googlegroups.com
> Cc: Alessandro Zummo <a.zummo at towertech.it>
> Cc: devicetree-discuss at lists.ozlabs.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
> Signed-off-by: Dirk Brandewie <dirk.brandewie at gmail.com>
Itty-bitty nit below, but otherwise:
Acked-by: Grant Likely <grant.likely at secretlab.ca>
[...]
> diff --git a/include/linux/of.h b/include/linux/of.h
> index d9dd664..8de7c29 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -70,6 +70,11 @@ extern struct device_node *allnodes;
> extern struct device_node *of_chosen;
> extern rwlock_t devtree_lock;
>
> +static inline int of_have_populated_dt(void)
Personally, I'd make this a 'bool' return value.
> +{
> + return allnodes != NULL;
> +}
> +
> static inline bool of_node_is_root(const struct device_node *node)
> {
> return node && (node->parent == NULL);
> @@ -222,5 +227,12 @@ extern void of_attach_node(struct device_node *);
> extern void of_detach_node(struct device_node *);
> #endif
>
> +#else
> +
> +static inline int of_have_populated_dt(void)
> +{
> + return 0;
and then 'return false'; here.
But by *no means* should this patch be delayed by this comment. :-)
g.
More information about the devicetree-discuss
mailing list