aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl1251
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2010-11-03 18:13:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:27:02 -0500
commite4b3fdb80021bc0a3239bfc2a873a6d7c6ac52a1 (patch)
treeed955270792c46c6c8687ea0f5d19dc81c9e2a49 /drivers/net/wireless/wl1251
parent1d4b89f2970f9ea0902d0a3bc1090f3c770b5080 (diff)
wl1251: use wl12xx_platform_data to pass data
Make use the newly added method to pass platform data for wl1251 too. This allows to eliminate some redundant code. Cc: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Kalle Valo <kvalo@adurom.com> Acked-by: Luciano Coelho <luciano.coelho@nokia.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl1251')
-rw-r--r--drivers/net/wireless/wl1251/sdio.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c
index f3e185efe124..596d90ecba33 100644
--- a/drivers/net/wireless/wl1251/sdio.c
+++ b/drivers/net/wireless/wl1251/sdio.c
@@ -43,8 +43,6 @@ struct wl1251_sdio {
43 u32 elp_val; 43 u32 elp_val;
44}; 44};
45 45
46static struct wl12xx_platform_data *wl12xx_board_data;
47
48static struct sdio_func *wl_to_func(struct wl1251 *wl) 46static struct sdio_func *wl_to_func(struct wl1251 *wl)
49{ 47{
50 struct wl1251_sdio *wl_sdio = wl->if_priv; 48 struct wl1251_sdio *wl_sdio = wl->if_priv;
@@ -219,30 +217,6 @@ static struct wl1251_if_operations wl1251_sdio_ops = {
219 .power = wl1251_sdio_set_power, 217 .power = wl1251_sdio_set_power,
220}; 218};
221 219
222static int wl1251_platform_probe(struct platform_device *pdev)
223{
224 if (pdev->id != -1) {
225 wl1251_error("can only handle single device");
226 return -ENODEV;
227 }
228
229 wl12xx_board_data = pdev->dev.platform_data;
230 return 0;
231}
232
233/*
234 * Dummy platform_driver for passing platform_data to this driver,
235 * until we have a way to pass this through SDIO subsystem or
236 * some other way.
237 */
238static struct platform_driver wl1251_platform_driver = {
239 .driver = {
240 .name = "wl1251_data",
241 .owner = THIS_MODULE,
242 },
243 .probe = wl1251_platform_probe,
244};
245
246static int wl1251_sdio_probe(struct sdio_func *func, 220static int wl1251_sdio_probe(struct sdio_func *func,
247 const struct sdio_device_id *id) 221 const struct sdio_device_id *id)
248{ 222{
@@ -250,6 +224,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,
250 struct wl1251 *wl; 224 struct wl1251 *wl;
251 struct ieee80211_hw *hw; 225 struct ieee80211_hw *hw;
252 struct wl1251_sdio *wl_sdio; 226 struct wl1251_sdio *wl_sdio;
227 const struct wl12xx_platform_data *wl12xx_board_data;
253 228
254 hw = wl1251_alloc_hw(); 229 hw = wl1251_alloc_hw();
255 if (IS_ERR(hw)) 230 if (IS_ERR(hw))
@@ -276,6 +251,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,
276 wl->if_priv = wl_sdio; 251 wl->if_priv = wl_sdio;
277 wl->if_ops = &wl1251_sdio_ops; 252 wl->if_ops = &wl1251_sdio_ops;
278 253
254 wl12xx_board_data = wl12xx_get_platform_data();
279 if (wl12xx_board_data != NULL) { 255 if (wl12xx_board_data != NULL) {
280 wl->set_power = wl12xx_board_data->set_power; 256 wl->set_power = wl12xx_board_data->set_power;
281 wl->irq = wl12xx_board_data->irq; 257 wl->irq = wl12xx_board_data->irq;
@@ -378,12 +354,6 @@ static int __init wl1251_sdio_init(void)
378{ 354{
379 int err; 355 int err;
380 356
381 err = platform_driver_register(&wl1251_platform_driver);
382 if (err) {
383 wl1251_error("failed to register platform driver: %d", err);
384 return err;
385 }
386
387 err = sdio_register_driver(&wl1251_sdio_driver); 357 err = sdio_register_driver(&wl1251_sdio_driver);
388 if (err) 358 if (err)
389 wl1251_error("failed to register sdio driver: %d", err); 359 wl1251_error("failed to register sdio driver: %d", err);
@@ -393,7 +363,6 @@ static int __init wl1251_sdio_init(void)
393static void __exit wl1251_sdio_exit(void) 363static void __exit wl1251_sdio_exit(void)
394{ 364{
395 sdio_unregister_driver(&wl1251_sdio_driver); 365 sdio_unregister_driver(&wl1251_sdio_driver);
396 platform_driver_unregister(&wl1251_platform_driver);
397 wl1251_notice("unloaded"); 366 wl1251_notice("unloaded");
398} 367}
399 368