diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2014-04-01 10:02:53 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-04-11 03:29:16 -0400 |
commit | 848ef58695d8c013f24633352586279cfb40e9d9 (patch) | |
tree | 2aca76ac9a074b385459b0a7dd98ebf00c7a8e26 | |
parent | 7bd494491be0a330df74bb7f79427f5604060585 (diff) |
net: rfkill: gpio: remove unused and obsolete platform parameters
After upgrading to descriptor based gpios, the gpio numbers
are not used anymore. The power_clk_name and the platform
specific setup and close hooks are not used by anybody, and
we should not encourage use of such things, so removing them.
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | include/linux/rfkill-gpio.h | 10 | ||||
-rw-r--r-- | net/rfkill/rfkill-gpio.c | 15 |
2 files changed, 1 insertions, 24 deletions
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h index 4d09f6eab359..20bcb55498cd 100644 --- a/include/linux/rfkill-gpio.h +++ b/include/linux/rfkill-gpio.h | |||
@@ -27,21 +27,11 @@ | |||
27 | * struct rfkill_gpio_platform_data - platform data for rfkill gpio device. | 27 | * struct rfkill_gpio_platform_data - platform data for rfkill gpio device. |
28 | * for unused gpio's, the expected value is -1. | 28 | * for unused gpio's, the expected value is -1. |
29 | * @name: name for the gpio rf kill instance | 29 | * @name: name for the gpio rf kill instance |
30 | * @reset_gpio: GPIO which is used for reseting rfkill switch | ||
31 | * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch | ||
32 | * @power_clk_name: [optional] name of clk to turn off while blocked | ||
33 | * @gpio_runtime_close: clean up platform specific gpio configuration | ||
34 | * @gpio_runtime_setup: set up platform specific gpio configuration | ||
35 | */ | 30 | */ |
36 | 31 | ||
37 | struct rfkill_gpio_platform_data { | 32 | struct rfkill_gpio_platform_data { |
38 | char *name; | 33 | char *name; |
39 | int reset_gpio; | ||
40 | int shutdown_gpio; | ||
41 | const char *power_clk_name; | ||
42 | enum rfkill_type type; | 34 | enum rfkill_type type; |
43 | void (*gpio_runtime_close)(struct platform_device *); | ||
44 | int (*gpio_runtime_setup)(struct platform_device *); | ||
45 | }; | 35 | }; |
46 | 36 | ||
47 | #endif /* __RFKILL_GPIO_H */ | 37 | #endif /* __RFKILL_GPIO_H */ |
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index bd2a5b90400c..0adda445dfe7 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c | |||
@@ -87,7 +87,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
87 | { | 87 | { |
88 | struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data; | 88 | struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data; |
89 | struct rfkill_gpio_data *rfkill; | 89 | struct rfkill_gpio_data *rfkill; |
90 | const char *clk_name = NULL; | ||
91 | struct gpio_desc *gpio; | 90 | struct gpio_desc *gpio; |
92 | int ret; | 91 | int ret; |
93 | int len; | 92 | int len; |
@@ -101,7 +100,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
101 | if (ret) | 100 | if (ret) |
102 | return ret; | 101 | return ret; |
103 | } else if (pdata) { | 102 | } else if (pdata) { |
104 | clk_name = pdata->power_clk_name; | ||
105 | rfkill->name = pdata->name; | 103 | rfkill->name = pdata->name; |
106 | rfkill->type = pdata->type; | 104 | rfkill->type = pdata->type; |
107 | } else { | 105 | } else { |
@@ -120,7 +118,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
120 | snprintf(rfkill->reset_name, len + 6 , "%s_reset", rfkill->name); | 118 | snprintf(rfkill->reset_name, len + 6 , "%s_reset", rfkill->name); |
121 | snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", rfkill->name); | 119 | snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", rfkill->name); |
122 | 120 | ||
123 | rfkill->clk = devm_clk_get(&pdev->dev, clk_name); | 121 | rfkill->clk = devm_clk_get(&pdev->dev, NULL); |
124 | 122 | ||
125 | gpio = devm_gpiod_get_index(&pdev->dev, rfkill->reset_name, 0); | 123 | gpio = devm_gpiod_get_index(&pdev->dev, rfkill->reset_name, 0); |
126 | if (!IS_ERR(gpio)) { | 124 | if (!IS_ERR(gpio)) { |
@@ -146,14 +144,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
146 | return -EINVAL; | 144 | return -EINVAL; |
147 | } | 145 | } |
148 | 146 | ||
149 | if (pdata && pdata->gpio_runtime_setup) { | ||
150 | ret = pdata->gpio_runtime_setup(pdev); | ||
151 | if (ret) { | ||
152 | dev_err(&pdev->dev, "can't set up gpio\n"); | ||
153 | return ret; | ||
154 | } | ||
155 | } | ||
156 | |||
157 | rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev, | 147 | rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev, |
158 | rfkill->type, &rfkill_gpio_ops, | 148 | rfkill->type, &rfkill_gpio_ops, |
159 | rfkill); | 149 | rfkill); |
@@ -174,10 +164,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
174 | static int rfkill_gpio_remove(struct platform_device *pdev) | 164 | static int rfkill_gpio_remove(struct platform_device *pdev) |
175 | { | 165 | { |
176 | struct rfkill_gpio_data *rfkill = platform_get_drvdata(pdev); | 166 | struct rfkill_gpio_data *rfkill = platform_get_drvdata(pdev); |
177 | struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data; | ||
178 | 167 | ||
179 | if (pdata && pdata->gpio_runtime_close) | ||
180 | pdata->gpio_runtime_close(pdev); | ||
181 | rfkill_unregister(rfkill->rfkill_dev); | 168 | rfkill_unregister(rfkill->rfkill_dev); |
182 | rfkill_destroy(rfkill->rfkill_dev); | 169 | rfkill_destroy(rfkill->rfkill_dev); |
183 | 170 | ||