Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Alexander Aring
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,at86rf21

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Varka Bhadram
> > 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); > >

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Varka Bhadram
> filename: > /lib/modules/3.14.0-rc8-01856-g8652599/kernel/drivers/net/ieee802154/at86rf230.ko > license: GPL v2 > description: AT86RF230 Transceiver Driver > srcversion: 046691C0B2230A291E98B63 > alias: of:N*T*Catmel,at86rf212* > alias: of:N*T*Catmel,at86rf233* > alias: of:N*T*Catmel,at86rf231*

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Alexander Aring
Hi, On Thu, Mar 27, 2014 at 11:46:10AM +0100, Alexander Aring wrote: > 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 def

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Alexander Aring
Hi Varka, On Thu, Mar 27, 2014 at 03:35:17PM +0530, Varka Bhadram wrote: > > > no, of_match_ptr will return NULL if CONFIG_OF is not defined. We don't > > need any IS_ENABLED(CONFIG_OF). > > > > see include/linux/of.h line 521 > > > > - Alex > > You are correct. I think the only way is > > #ifd

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Varka Bhadram
> no, of_match_ptr will return NULL if CONFIG_OF is not defined. We don't > need any IS_ENABLED(CONFIG_OF). > > see include/linux/of.h line 521 > > - Alex You are correct. I think the only way is #ifdef CONFIG_OF static struct of_device_id at86rf230_of_match [] = { { . compatible = "atmel,at86rf

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Alexander Aring
On Thu, Mar 27, 2014 at 02:31:07PM +0530, Varka Bhadram wrote: > Hai Alex, > > > btw. I think the else would be here wrong because we can boot also > > without devicetree if devicetree is enabled.I only see sometimes a > > #ifdef CONFIG_OF in driver to give the compiler a little help to remove > >

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Varka Bhadram
Hai Alex, > btw. I think the else would be here wrong because we can boot also > without devicetree if devicetree is enabled.I only see sometimes a > #ifdef CONFIG_OF in driver to give the compiler a little help to remove > the struct if it's not enabled. > Ya you are right. But there is fundamen

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Alexander Aring
On Thu, Mar 27, 2014 at 12:49:55PM +0530, Varka Bhadram wrote: > > Ya its okay for me . But I think the code should be > > #if IS_ENABLED(CONFIG_OF) //For DT supported > boards > static struct of_device_id at86rf230_of_match [] = { > { . compatible = "atme

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Alexander Aring
On Thu, Mar 27, 2014 at 12:49:55PM +0530, Varka Bhadram wrote: > > Ya its okay for me . But I think the code should be > > #if IS_ENABLED(CONFIG_OF) //For DT supported > boards > static struct of_device_id at86rf230_of_match [] = { > { . compatible = "atme

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-27 Thread Varka Bhadram
Ya its okay for me . But I think the code should be #if IS_ENABLED(CONFIG_OF) //For DT supported boards static struct of_device_id at86rf230_of_match [] = { { . compatible = "atmel,at86rf230" , }, { . compatible = "atmel,at86rf231" , }, { .

Re: [Linux-zigbee-devel] at86rf230: DT and Non-DT support question

2014-03-26 Thread Alexander Aring
On Thu, Mar 27, 2014 at 10:55:57AM +0530, Varka Bhadram wrote: > Hai, > > By using struct of_device_id structure and of_match_table in struct spi_driver > we can enable the device tree support for the driver. The corresponding driver > will be loaded based on compatible property. > > For Non-DT s