> 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,at86rf230" , },
{ . compatible = "atmel,at86rf231" , },
{ . compatible = "atmel,at86rf233" , },
{ . compatible = "atmel,at86rf212" , },
{ },
};
MODULE_DEVICE_TABLE(of,  at86rf230_of_match);
#else
static const struct spi_device_id at86rf230_ids [] = {         //For Non-DT
supported boards
{ "at86rf230" , 0 },
..............
{ },
};
MODULE_DEVICE_TABLE ( spi , at86rf230_ids );
#endif

static struct spi_driver at86rf230_driver = {
     . driver = {
              #ifdef CONFIG_OF
             . of_match_table = of_match_ptr ( at86rf230_of_match ),
             #endif
             . name   = "at86rf230" ,                 .
             owner   = THIS_MODULE ,
      };
      . probe       = at86rf230_probe ,
      . remove     = at86rf230_remove ,
};

Varka Bhadram,
CDAC-HYD
-------------------------------------------------------------------------------------------------------------------------------

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