[2/2] net: wireless: ti: wl1251: sdio: remove ti,power-gpio
diff mbox series

Message ID e1f18e0f1401a0d8b07ccb176732a2e3f3a5732a.1574591746.git.hns@goldelico.com
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series
  • net: wireless: ti: wl1251: sdio: remove ti,power-gpio
Related show

Commit Message

H. Nikolaus Schaller Nov. 24, 2019, 10:35 a.m. UTC
Remove handling of this property from code.
Note that wl->power_gpio is still needed in
the header file for SPI mode (N900).

Suggested by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/net/wireless/ti/wl1251/sdio.c | 30 ---------------------------
 1 file changed, 30 deletions(-)

Comments

H. Nikolaus Schaller Nov. 24, 2019, 10:47 a.m. UTC | #1
> Am 24.11.2019 um 11:35 schrieb H. Nikolaus Schaller <hns@goldelico.com>:
> 
> Remove handling of this property from code.
> Note that wl->power_gpio is still needed in
> the header file for SPI mode (N900).
> 
> Suggested by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> ---
> drivers/net/wireless/ti/wl1251/sdio.c | 30 ---------------------------
> 1 file changed, 30 deletions(-)
> 
> diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
> index df0c20a555e3..82446196f9a8 100644
> --- a/drivers/net/wireless/ti/wl1251/sdio.c
> +++ b/drivers/net/wireless/ti/wl1251/sdio.c
> @@ -15,9 +15,7 @@
> #include <linux/wl12xx.h>
> #include <linux/irq.h>
> #include <linux/pm_runtime.h>
> -#include <linux/gpio.h>
> #include <linux/of.h>
> -#include <linux/of_gpio.h>
> #include <linux/of_irq.h>
> 
> #include "wl1251.h"
> @@ -162,15 +160,6 @@ static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable)
> printk("%s %d\n", __func__, enable);
> 
> 	if (enable) {
> -		/*
> -		 * Power is controlled by runtime PM, but we still call board
> -		 * callback in case it wants to do any additional setup,
> -		 * for example enabling clock buffer for the module.
> -		 */
> -		if (gpio_is_valid(wl->power_gpio))
> -			gpio_set_value(wl->power_gpio, true);
> -
> -
> 		ret = pm_runtime_get_sync(&func->dev);
> 		if (ret < 0) {
> 			pm_runtime_put_sync(&func->dev);
> @@ -188,9 +177,6 @@ printk("%s %d\n", __func__, enable);
> 		ret = pm_runtime_put_sync(&func->dev);
> 		if (ret < 0)
> 			goto out;
> -
> -		if (gpio_is_valid(wl->power_gpio))
> -			gpio_set_value(wl->power_gpio, false);
> 	}
> 
> out:
> @@ -245,27 +231,11 @@ printk("%s: of=%pOFcC\n", __func__, np);
> 
> 	wl1251_board_data = wl1251_get_platform_data();
> 	if (!IS_ERR(wl1251_board_data)) {
> -		wl->power_gpio = wl1251_board_data->power_gpio;
> 		wl->irq = wl1251_board_data->irq;
> 		wl->use_eeprom = wl1251_board_data->use_eeprom;
> 	} else if (np) {
> 		wl->use_eeprom =of_property_read_bool(np, "ti,wl1251-has-eeprom");
> -		wl->power_gpio = of_get_named_gpio(np, "ti,power-gpio", 0);
> 		wl->irq = of_irq_get(np, 0);
> -
> -		if (wl->power_gpio == -EPROBE_DEFER || wl->irq == -EPROBE_DEFER) {

^^^ spotted a bug myself... wl->irq check must not be removed.

Noted for v2.


> -			ret = -EPROBE_DEFER;
> -			goto disable;
> -		}
> -	}
> -
> -	if (gpio_is_valid(wl->power_gpio)) {
> -		ret = devm_gpio_request(&func->dev, wl->power_gpio,
> -								"wl1251 power");
> -		if (ret) {
> -			wl1251_error("Failed to request gpio: %d\n", ret);
> -			goto disable;
> -		}
> 	}
> 
> 	if (wl->irq) {
> -- 
> 2.23.0
>
Kalle Valo Nov. 26, 2019, 3:53 p.m. UTC | #2
"H. Nikolaus Schaller" <hns@goldelico.com> writes:

> Remove handling of this property from code.
> Note that wl->power_gpio is still needed in
> the header file for SPI mode (N900).
>
> Suggested by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> ---
>  drivers/net/wireless/ti/wl1251/sdio.c | 30 ---------------------------
>  1 file changed, 30 deletions(-)

Please use "wl1251: " as title prefix, no need to have the full
directory structure there.
H. Nikolaus Schaller Nov. 26, 2019, 4:35 p.m. UTC | #3
> Am 26.11.2019 um 16:53 schrieb Kalle Valo <kvalo@codeaurora.org>:
> 
> "H. Nikolaus Schaller" <hns@goldelico.com> writes:
> 
>> Remove handling of this property from code.
>> Note that wl->power_gpio is still needed in
>> the header file for SPI mode (N900).
>> 
>> Suggested by: Ulf Hansson <ulf.hansson@linaro.org>
>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>> ---
>> drivers/net/wireless/ti/wl1251/sdio.c | 30 ---------------------------
>> 1 file changed, 30 deletions(-)
> 
> Please use "wl1251: " as title prefix, no need to have the full
> directory structure there.

Ok, noted for v2.

BR and thanks,
Nikolaus

Patch
diff mbox series

diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
index df0c20a555e3..82446196f9a8 100644
--- a/drivers/net/wireless/ti/wl1251/sdio.c
+++ b/drivers/net/wireless/ti/wl1251/sdio.c
@@ -15,9 +15,7 @@ 
 #include <linux/wl12xx.h>
 #include <linux/irq.h>
 #include <linux/pm_runtime.h>
-#include <linux/gpio.h>
 #include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 
 #include "wl1251.h"
@@ -162,15 +160,6 @@  static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable)
 printk("%s %d\n", __func__, enable);
 
 	if (enable) {
-		/*
-		 * Power is controlled by runtime PM, but we still call board
-		 * callback in case it wants to do any additional setup,
-		 * for example enabling clock buffer for the module.
-		 */
-		if (gpio_is_valid(wl->power_gpio))
-			gpio_set_value(wl->power_gpio, true);
-
-
 		ret = pm_runtime_get_sync(&func->dev);
 		if (ret < 0) {
 			pm_runtime_put_sync(&func->dev);
@@ -188,9 +177,6 @@  printk("%s %d\n", __func__, enable);
 		ret = pm_runtime_put_sync(&func->dev);
 		if (ret < 0)
 			goto out;
-
-		if (gpio_is_valid(wl->power_gpio))
-			gpio_set_value(wl->power_gpio, false);
 	}
 
 out:
@@ -245,27 +231,11 @@  printk("%s: of=%pOFcC\n", __func__, np);
 
 	wl1251_board_data = wl1251_get_platform_data();
 	if (!IS_ERR(wl1251_board_data)) {
-		wl->power_gpio = wl1251_board_data->power_gpio;
 		wl->irq = wl1251_board_data->irq;
 		wl->use_eeprom = wl1251_board_data->use_eeprom;
 	} else if (np) {
 		wl->use_eeprom =of_property_read_bool(np, "ti,wl1251-has-eeprom");
-		wl->power_gpio = of_get_named_gpio(np, "ti,power-gpio", 0);
 		wl->irq = of_irq_get(np, 0);
-
-		if (wl->power_gpio == -EPROBE_DEFER || wl->irq == -EPROBE_DEFER) {
-			ret = -EPROBE_DEFER;
-			goto disable;
-		}
-	}
-
-	if (gpio_is_valid(wl->power_gpio)) {
-		ret = devm_gpio_request(&func->dev, wl->power_gpio,
-								"wl1251 power");
-		if (ret) {
-			wl1251_error("Failed to request gpio: %d\n", ret);
-			goto disable;
-		}
 	}
 
 	if (wl->irq) {