1 Move the wl1251 part of the wl12xx platform data structure into a new
2 structure specifically for wl1251. Change the platform data built-in
3 block and board files accordingly.
5 Cc: Tony Lindgren <tony@atomide.com>
6 Signed-off-by: Luciano Coelho <coelho@ti.com>
7 Acked-by: Tony Lindgren <tony@atomide.com>
8 Reviewed-by: Felipe Balbi <balbi@ti.com>
10 --- a/drivers/net/wireless/ti/wilink_platform_data.c
11 +++ b/drivers/net/wireless/ti/wilink_platform_data.c
13 #include <linux/err.h>
14 #include <linux/wl12xx.h>
16 -static struct wl12xx_platform_data *platform_data;
17 +static struct wl12xx_platform_data *wl12xx_platform_data;
19 int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
22 + if (wl12xx_platform_data)
27 - platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
29 + wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
30 + if (!wl12xx_platform_data)
34 @@ -41,9 +41,34 @@ int __init wl12xx_set_platform_data(cons
36 struct wl12xx_platform_data *wl12xx_get_platform_data(void)
39 + if (!wl12xx_platform_data)
40 return ERR_PTR(-ENODEV);
42 - return platform_data;
43 + return wl12xx_platform_data;
45 EXPORT_SYMBOL(wl12xx_get_platform_data);
47 +static struct wl1251_platform_data *wl1251_platform_data;
49 +int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
51 + if (wl1251_platform_data)
56 + wl1251_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
57 + if (!wl1251_platform_data)
63 +struct wl1251_platform_data *wl1251_get_platform_data(void)
65 + if (!wl1251_platform_data)
66 + return ERR_PTR(-ENODEV);
68 + return wl1251_platform_data;
70 +EXPORT_SYMBOL(wl1251_get_platform_data);
71 --- a/drivers/net/wireless/ti/wl1251/sdio.c
72 +++ b/drivers/net/wireless/ti/wl1251/sdio.c
73 @@ -227,7 +227,7 @@ static int wl1251_sdio_probe(struct sdio
75 struct ieee80211_hw *hw;
76 struct wl1251_sdio *wl_sdio;
77 - const struct wl12xx_platform_data *wl12xx_board_data;
78 + const struct wl1251_platform_data *wl1251_board_data;
80 hw = wl1251_alloc_hw();
82 @@ -254,11 +254,11 @@ static int wl1251_sdio_probe(struct sdio
83 wl->if_priv = wl_sdio;
84 wl->if_ops = &wl1251_sdio_ops;
86 - wl12xx_board_data = wl12xx_get_platform_data();
87 - if (!IS_ERR(wl12xx_board_data)) {
88 - wl->set_power = wl12xx_board_data->set_power;
89 - wl->irq = wl12xx_board_data->irq;
90 - wl->use_eeprom = wl12xx_board_data->use_eeprom;
91 + wl1251_board_data = wl1251_get_platform_data();
92 + if (!IS_ERR(wl1251_board_data)) {
93 + wl->set_power = wl1251_board_data->set_power;
94 + wl->irq = wl1251_board_data->irq;
95 + wl->use_eeprom = wl1251_board_data->use_eeprom;
99 --- a/drivers/net/wireless/ti/wl1251/spi.c
100 +++ b/drivers/net/wireless/ti/wl1251/spi.c
101 @@ -241,7 +241,7 @@ static const struct wl1251_if_operations
103 static int wl1251_spi_probe(struct spi_device *spi)
105 - struct wl12xx_platform_data *pdata;
106 + struct wl1251_platform_data *pdata;
107 struct ieee80211_hw *hw;