On Thu, Mar 27, 2014 at 05:26:30PM +0530, Varka Bhadram wrote:
> 
> > > static const struct of_device_id at86rf230_of_match[] = {
> > > { .compatible = "atmel,at86rf230", },
> > > { .compatible = "atmel,at86rf231", },
> > > { .compatible = "atmel,at86rf233", },
> > > { .compatible = "atmel,at86rf212", },
> > > { },
> > > };
> > > MODULE_DEVICE_TABLE(of, at86rf230_of_match);
> > >
> 
> If you don't include this code
> 
> > > static const struct spi_device_id at86rf230_device_id[] = {
> > > { .name = "at86rf230", },
> > > { .name = "at86rf231", },
> > > { .name = "at86rf233", },
> > > { .name = "at86rf212", },
> > > { },
> > > };
> > > MODULE_DEVICE_TABLE(spi, at86rf230_device_id);
> > >
> if you include this
> 
> > > static struct spi_driver at86rf230_driver = {
> > > .id_table = at86rf230_device_id,
> > > .driver = {
> > >
> /*.of_match_table = of_match_ptr(at86rf230_of_match),*/
> 
> > > .name = "at86rf230",
> > > .owner = THIS_MODULE,
> > > },
> > > .probe = at86rf230_probe,
> > > .remove = at86rf230_remove,
> > > };
> 
> In this case when you use the overlay to load the driver , the linux kernel 
> spi
> core is loading the driver.
> So those device ids are global device ids. In this case no need of including 
> the
> of_device_id's.
> 

of_match_ptr is implemented like this:

#if IS_ENABLED(CONFIG_OF)
#define of_match_ptr(_ptr)      (_ptr)
#else
#define of_match_ptr(_ptr)      NULL
#endif

thats the same like:

#if IS_ENABLED(CONFIG_OF)
.of_match_table = at86rf230_of_match,
#endif

note that we don't use of_match_ptr here.

- Alex

------------------------------------------------------------------------------
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to