[PATCH v3 4/4] memory: emif: add device tree support to emif driver
Shilimkar, Santosh
santosh.shilimkar at ti.com
Tue Jun 26 03:49:15 EDT 2012
On Tue, Jun 26, 2012 at 10:56 AM, Rajendra Nayak <rnayak at ti.com> wrote:
> On Tuesday 26 June 2012 10:53 AM, Shilimkar, Santosh wrote:
>>
>> On Tue, Jun 26, 2012 at 10:49 AM, Rajendra Nayak<rnayak at ti.com> wrote:
>>>
>>> On Tuesday 26 June 2012 10:39 AM, Shilimkar, Santosh wrote:
>>>>>>
>>>>>>
>>>>>> +#if defined(CONFIG_OF)
>>>>>>>
>>>>>>> > +static const struct of_device_id emif_of_match[] = {
>>>>>>> > + { .compatible = "ti,emif-4d" },
>>>>>>> > + { .compatible = "ti,emif-4d5" },
>>>>>>> > + {},
>>>>>>> > +};
>>>>>>> > +MODULE_DEVICE_TABLE(of, emif_of_match);
>>>>>>> > +#endif
>>>>>>> > +
>>>>>>> > static struct platform_driver emif_driver = {
>>>>>>> > .remove = __exit_p(emif_remove),
>>>>>>> > .shutdown = emif_shutdown,
>>>>>>> > .driver = {
>>>>>>> > .name = "emif",
>>>>>>> > +#if defined(CONFIG_OF)
>>>>>>> > + .of_match_table = of_match_ptr(emif_of_match),
>>>>>>> > +#endif
>>>>>
>>>>>
>>>>>>
>>>>>> Are these two still #if defined needed?
>>>>>>
>>>>>> Also, what about the IS_DEFINED macro?
>>>>>>
>>>>
>>>> Yes. To avoid the build break in !DT build.
>>>>
>>>
>>> No, infact of_match_ptr is there just so you can avoid a
>>> #ifdef around and not break !CONFIG_OF.
>>
>>
>> Need to recheck but the build was throwing error becasue of
>> "emif_of_match"
>> mostly.
>
>
> You still need the first one. I meant the second one around
> 'of_match_ptr' should be removed.
>
> With !CONFIG_OF, of_match_ptr(_ptr) is just defined as NULL.
>
Yep. That make sense too.
Will drop the second check.
regards
Santosh
More information about the linux-arm-kernel
mailing list