[PATCH 2/2] maps/mtd-ram: add an of-platform driver
Grant Likely
grant.likely at secretlab.ca
Thu May 21 00:21:05 EDT 2009
On Wed, May 20, 2009 at 6:46 PM, Wolfram Sang <w.sang at pengutronix.de> wrote:
>> > + name = of_get_property(op->node, "name", NULL);
>> > + if (!name) {
>> > + ret = -ENOENT;
>> > + dev_dbg(&op->dev, "could not get node name\n");
>> > + goto bad1;
>> > + }
>
> Can I just use
>
> name = op->node->name
>
> here? I wonder because of_device in asm/of_device.h states 'node' as "to be
> obsoleted"
It may be labeled as such, but it's been so for over 2 years now, and
op->node is used all over the place. I think Ben would like to
eventually move to using the node pointer in archdata, but that will
require a fair bit of refactoring.
Ben will kick me if I'm wrong, but I'll go out on a limb and say that
I think you're okay to use it.
>. And could I safely assume that all architectures will have the node
> entry?
All three current users do.
>> > +static struct of_device_id of_ram_match[] = {
>> > + { .compatible = "mtd-ram", },
>> > + {},
>> > +};
>> > +MODULE_DEVICE_TABLE(of, of_ram_match);
>> > +
>> > +static struct of_platform_driver of_ram_driver = {
>>
>> __devinitdata
>
> I assume you mean the match_table and not the of_platform_driver. Shouldn't it
> even better be const and using __devinitconst?
correct on both counts.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
More information about the linux-mtd
mailing list