---------- Original Message ----------
From: Varka Bhadram <var...@cdac.in>
To: Alexander Aring <alex.ar...@gmail.com>
Date: March 27, 2014 at 4:30 PM
Subject: Re: at86rf230: DT and Non-DT support question


> We also need a
>
> .id_table = at86rf230_ids,
>
> here.
>
> > . driver = {
> > #ifdef CONFIG_OF
> > . of_match_table = of_match_ptr ( at86rf230_of_match ),
>
> Linux handle this #ifdef CONFIG_OF already in of.h
>
> A static struct declaration is an already zeroed memory space, so we
> don't need a #ifdef CONFIG_OF here and we should have a small codebase.
>
> if CONFIG_OF is not defined "of_match_ptr" will return NULL otherwise it
> returns the at86rf230_of_match pointer.
>
>
> 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);
>
> static const struct spi_device_id at86rf230_device_id[] = {
> { .name = "at86rf230", },
> { .name = "at86rf231", },
> { .name = "at86rf233", },
> { .name = "at86rf212", },
> { },
> };
> MODULE_DEVICE_TABLE(spi, at86rf230_device_id);
>
> 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,
> };
>
> Let me know if you are fine with that.
>
> - Alex

Its fine, But in the device table two ids will be created which are
corresponding to single driver.

Because of MODULE_DEVICE_TABLE(of, at86rf230_of_match) and
MODULE_DEVICE_TABLE(spi, at86rf230_device_id) two ids will be created . This is
my view.
If i am wrong correct me.

-Varka Bhadram
-------------------------------------------------------------------------------------------------------------------------------

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

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

Reply via email to