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

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

 



On Sun, 2012-02-12 at 11:13 -0800, Marc Dietrich wrote:
> This adds device tree support for rfkill-gpio. The optional platform
> paramters gpio_runtime_close and gpio_runtime_setup are not implemented.
> 
> Cc: linux-wireless@xxxxxxxxxxxxxxx
> Cc: "John W. Linville" <linville@xxxxxxxxxxxxx>
> Cc: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
> Cc: Rhyland Klein <rklein@xxxxxxxxxx>
> Signed-off-by: Marc Dietrich <marvin24@xxxxxx>
> +
>  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);
> +

The only concern I have is the precedence of devicetree settings vs
platform data settings? If there is pdata passed in from board file
initialization, and there is a device tree (a corner case but I think a
valid one) then I believe the order would be that defined pdata would
override the devicetree settings. That way if someone wanted to make a
quick update, they wouldn't need to change the boot loader as well.

>  	if (!pdata) {
>  		pr_warn("%s: No platform data specified\n", __func__);
>  		return -EINVAL;
> @@ -217,6 +273,7 @@ static struct platform_driver rfkill_gpio_driver = {
>  	.driver = {
>  		   .name = "rfkill_gpio",
>  		   .owner = THIS_MODULE,
> +		   .of_match_table = of_match_ptr(of_rfkill_gpio_match),
>  	},
>  };
>  

-rhyland

--
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