Re: Re: [PATCH 1/3] net: rfkill-gpio: add device tree support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Sonntag, 5. Februar 2012, 20:59:24 schrieb Thierry Reding:
> * Marc Dietrich wrote:
> > +#ifdef CONFIG_OF
> 
> [...]
> 
> > +#else
> 
> [...]
> 
> > +#define of_rfkill_gpio_match NULL
> 
> This can be dropped, see below.
> 
> > +#endif
> > +
> > 
> >  static int rfkill_gpio_probe(struct platform_device *pdev)
> >  {
> >  
> >  	struct rfkill_gpio_data *rfkill;
> >  	struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
> > 
> > +	struct device_node *np = pdev->dev.of_node;
> > 
> >  	int ret = 0;
> >  	int len = 0;
> > 
> > +	if (np)
> > +		pdata = rfkill_gpio_parse_pdata(pdev);
> > +
> > 
> >  	if (!pdata) {
> >  	
> >  		pr_warn("%s: No platform data specified\n", __func__);
> >  		return -EINVAL;
> > 
> > @@ -210,13 +268,13 @@ static int rfkill_gpio_remove(struct platform_device
> > *pdev)> 
> >  	return 0;
> >  
> >  }
> > 
> > -
> 
> Are you removing this line on purpose?

of course not ;-)

> >  static struct platform_driver rfkill_gpio_driver = {
> >  
> >  	.probe = rfkill_gpio_probe,
> >  	.remove = __devexit_p(rfkill_gpio_remove),
> >  	.driver = {
> >  	
> >  		   .name = "rfkill_gpio",
> >  		   .owner = THIS_MODULE,
> > 
> > +		   .of_match_table = of_rfkill_gpio_match,
> 
> I think the canonical way to do this is of_match_ptr() and leave out the
> definition to NULL in the !CONFIG_OF above.

yes, the OF api is changing in such a fast way, that it is getting hard to track it, 
especially if there are many drivers which use different generations of it. 

I'll fix it up in the next iteration.

Thanks

Marc

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux