[PATCH 2/3] ARM: tegra: paz00: export the WIFI rfkill gpio

Stephen Warren swarren at nvidia.com
Fri Jul 15 12:53:38 EDT 2011


Marc Dietrich wrote at Friday, July 15, 2011 4:24 AM:
> This makes the WIFI rfkill gpio available to userspace. On boot,
> WIFI will be unblocked by default.
...
> +static void __init paz00_wifi_init(void)
> +{
> +	int ret;
> +
> +	/* unlock hw rfkill */
> +	ret = gpio_request_one(TEGRA_WIFI_PWRN, GPIOF_OUT_INIT_HIGH,
> +		"wifi pwrn");
> +	if (ret) {
> +		pr_warning("WIFI: could not requestrfkill gpio\n");
> +		return;
> +	}
> +	gpio_export(TEGRA_WIFI_PWRN, 0);
> +};

Wouldn't you want to skip the gpio_export() call if the gpio_request()
call failed?

Of course, this is moot since Vasily mentioned the gpio-rfkill driver.
Luckily, that driver is already in Tegra's for-next, so it should be
pretty easy to adapt to.

-- 
nvpublic




More information about the linux-arm-kernel mailing list