Re: [PATCH/RFC] Add support for PowerQUICC watchdog

From: Stephen Rothwell
Date: Fri Dec 28 2007 - 23:03:44 EST


Hi Jochen,

Just a couple of suggestions.

On Fri, 28 Dec 2007 16:13:11 +0100 Jochen Friedrich <jochen@xxxxxxxx> wrote:
>
> +int __init pq_wdt_early_init(void)
> +{
>
> + data = of_get_property(soc, "bus-frequency", NULL);
> + if (!data) {
> + of_node_put(soc);
> + printk(KERN_ERR "Could not find bus-frequency in soc node\n");
> + ret = -ENODEV;
> + goto out;
> + }
> + of_node_put(soc);

If you move the "of_node_put(soc)" just above the "if (!data)" then you
won't need to repeat it.

> +static struct of_platform_driver pq_wdt_driver = {
> + .owner = THIS_MODULE,
> + .name = "pq-wdt",
> + .match_table = pq_wdt_match,
> + .probe = pq_wdt_probe,
> + .remove = pq_wdt_remove,
> +};

We are removing the owner and name fields from struct of_platform_driver, so the preferred initialization looks like this:

static struct of_platform_driver pq_wdt_driver = {
.match_table = pq_wdt_match,
.probe = pq_wdt_probe,
.remove = pq_wdt_remove,
.driver = {
.name = "pq-wdt",
.owner = THIS_MODULE,
}
};

or similar.

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/

Attachment: pgp00000.pgp
Description: PGP signature