[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OF5734B9D1.E734A7F1-ONC1257362.002FF979-C1257362.0031501B@de.ibm.com>
Date: Wed, 26 Sep 2007 10:58:37 +0200
From: Joachim Fenkes <FENKES@...ibm.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Christoph Raisch <raisch@...ibm.com>,
Jan-Bernd Themann <themann@...ibm.com>,
LKML <linux-kernel@...r.kernel.org>, linuxppc-dev@...abs.org,
Paul Mackerras <paulus@...ba.org>,
Paul Mackerras <pmac@....ibm.com>,
Stefan Roscher <stefan.roscher@...ibm.com>,
Thomas Q Klein <tklein@...ibm.com>
Subject: Re: [PATCH 3/5] ibmebus: Add device creation and bus probing based on of_device
> > +/* These devices will automatically be added to the bus during init
*/
> > +static struct of_device_id builtin_matches[] = {
> > + { .name = "lhca" },
> > + { .compatible = "IBM,lhca" },
> > + { .name = "lhea" },
> > + { .compatible = "IBM,lhea" },
> > + {},
> > +};
> > +
>
> Hmm, do you have devices that only have the matching name property
> but not the compatible property? If not, I'd suggest only looking
> for compatible, so you have less chance of false positives.
If a device that's not an lhca is called "lhca", that's its own fault, i
guess ;) But i concur that looking for the compatible property will
probably suffice.
> > +static int ibmebus_create_device(struct device_node *dn)
> > [...]
>
> nice!
Thanks.
> > - rc = IS_ERR(dev) ? PTR_ERR(dev) : count;
> > + rc = rc ? rc : count;
>
> the last line looks a bit silly. Maybe instead do
>
> rc = ibmebus_create_device(dn);
> of_node_put(dn);
> }
>
> kfree(path);
> if (rc)
> return rc;
> return count;
> }
More code lines? ;) But yes, that looks more like "standard kernel
pattern" - I'll change that.
Joachim
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists