[PATCH] net: rfkill: gpio: remove obsolete fields from platform data

From: Heikki Krogerus
Date: Fri Nov 22 2013 - 08:35:10 EST


The driver does not support the legacy GPIO API any more and
there are no users for the clock.

The platform setup hooks were apparently designed to be
used if platform specific configurations like pin
multiplexing needed handling. Now there is the pin control
subsystem that is designed to cover such things. In any
case, there are no users for those either.

Signed-off-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
---
include/linux/rfkill-gpio.h | 15 ++-------------
net/rfkill/rfkill-gpio.c | 25 -------------------------
2 files changed, 2 insertions(+), 38 deletions(-)

diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h
index 4d09f6e..2c65e5d 100644
--- a/include/linux/rfkill-gpio.h
+++ b/include/linux/rfkill-gpio.h
@@ -20,28 +20,17 @@
#ifndef __RFKILL_GPIO_H
#define __RFKILL_GPIO_H

-#include <linux/types.h>
#include <linux/rfkill.h>

/**
* struct rfkill_gpio_platform_data - platform data for rfkill gpio device.
- * for unused gpio's, the expected value is -1.
- * @name: name for the gpio rf kill instance
- * @reset_gpio: GPIO which is used for reseting rfkill switch
- * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch
- * @power_clk_name: [optional] name of clk to turn off while blocked
- * @gpio_runtime_close: clean up platform specific gpio configuration
- * @gpio_runtime_setup: set up platform specific gpio configuration
+ * @name: name for the gpio rfkill instance
+ * @type: rfkill type for the instance
*/

struct rfkill_gpio_platform_data {
char *name;
- int reset_gpio;
- int shutdown_gpio;
- const char *power_clk_name;
enum rfkill_type type;
- void (*gpio_runtime_close)(struct platform_device *);
- int (*gpio_runtime_setup)(struct platform_device *);
};

#endif /* __RFKILL_GPIO_H */
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index bd2a5b9..829da11 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -22,7 +22,6 @@
#include <linux/module.h>
#include <linux/rfkill.h>
#include <linux/platform_device.h>
-#include <linux/clk.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/gpio/consumer.h>
@@ -38,9 +37,6 @@ struct rfkill_gpio_data {
struct rfkill *rfkill_dev;
char *reset_name;
char *shutdown_name;
- struct clk *clk;
-
- bool clk_enabled;
};

static int rfkill_gpio_set_power(void *data, bool blocked)
@@ -50,17 +46,11 @@ static int rfkill_gpio_set_power(void *data, bool blocked)
if (blocked) {
gpiod_set_value(rfkill->shutdown_gpio, 0);
gpiod_set_value(rfkill->reset_gpio, 0);
- if (!IS_ERR(rfkill->clk) && rfkill->clk_enabled)
- clk_disable(rfkill->clk);
} else {
- if (!IS_ERR(rfkill->clk) && !rfkill->clk_enabled)
- clk_enable(rfkill->clk);
gpiod_set_value(rfkill->reset_gpio, 1);
gpiod_set_value(rfkill->shutdown_gpio, 1);
}

- rfkill->clk_enabled = blocked;
-
return 0;
}

@@ -87,7 +77,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
{
struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
struct rfkill_gpio_data *rfkill;
- const char *clk_name = NULL;
struct gpio_desc *gpio;
int ret;
int len;
@@ -101,7 +90,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
if (ret)
return ret;
} else if (pdata) {
- clk_name = pdata->power_clk_name;
rfkill->name = pdata->name;
rfkill->type = pdata->type;
} else {
@@ -120,8 +108,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
snprintf(rfkill->reset_name, len + 6 , "%s_reset", rfkill->name);
snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", rfkill->name);

- rfkill->clk = devm_clk_get(&pdev->dev, clk_name);
-
gpio = devm_gpiod_get_index(&pdev->dev, rfkill->reset_name, 0);
if (!IS_ERR(gpio)) {
ret = gpiod_direction_output(gpio, 0);
@@ -146,14 +132,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
return -EINVAL;
}

- if (pdata && pdata->gpio_runtime_setup) {
- ret = pdata->gpio_runtime_setup(pdev);
- if (ret) {
- dev_err(&pdev->dev, "can't set up gpio\n");
- return ret;
- }
- }
-
rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev,
rfkill->type, &rfkill_gpio_ops,
rfkill);
@@ -174,10 +152,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
static int rfkill_gpio_remove(struct platform_device *pdev)
{
struct rfkill_gpio_data *rfkill = platform_get_drvdata(pdev);
- struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;

- if (pdata && pdata->gpio_runtime_close)
- pdata->gpio_runtime_close(pdev);
rfkill_unregister(rfkill->rfkill_dev);
rfkill_destroy(rfkill->rfkill_dev);

--
1.8.4.3


--AhhlLboLdkugWU4S--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/