summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ti/wlcore/sdio.c
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2013-01-25 11:57:48 +0200
committerLuciano Coelho <coelho@ti.com>2013-02-08 10:05:02 +0200
commitafb43e6d88e587441c960a5d214d2c698d076c9c (patch)
treeb8df657e3e4e54c71e95f3972d7b9b05e286188d /drivers/net/wireless/ti/wlcore/sdio.c
parent3a0a8d961e20132272887d9826738ce9b4d818f7 (diff)
wlcore: remove if_ops from platform_data
We can't pass pointers from the platform data to the modules, because with DT it cannot be done. Those pointers are not set by the board files anyway. It's the bus modules that set them, so they can be safely removed from the platform data without changing any board files. Create a new structure that the bus modules pass to wlcore. This structure contains the if_ops pointers and a pointer to the actual platform data. Signed-off-by: Luciano Coelho <coelho@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/sdio.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/sdio.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index d4f184e2efed..1f6f6e30daca 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -218,6 +218,7 @@ static int wl1271_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
struct wl12xx_platform_data *wlan_data;
+ struct wlcore_platdev_data *pdev_data;
struct wl12xx_sdio_glue *glue;
struct resource res[1];
mmc_pm_flag_t mmcflags;
@@ -228,10 +229,18 @@ static int wl1271_probe(struct sdio_func *func,
if (func->num != 0x02)
return -ENODEV;
+ pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
+ if (!pdev_data) {
+ dev_err(&func->dev, "can't allocate platdev_data\n");
+ goto out;
+ }
+
+ pdev_data->if_ops = &sdio_ops;
+
glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&func->dev, "can't allocate glue\n");
- goto out;
+ goto out_free_pdev_data;
}
glue->dev = &func->dev;
@@ -256,8 +265,6 @@ static int wl1271_probe(struct sdio_func *func,
if (mmcflags & MMC_PM_KEEP_POWER)
wlan_data->pwr_in_suspend = true;
- wlan_data->ops = &sdio_ops;
-
sdio_set_drvdata(func, glue);
/* Tell PM core that we don't need the card to be powered now */
@@ -295,8 +302,10 @@ static int wl1271_probe(struct sdio_func *func,
goto out_dev_put;
}
- ret = platform_device_add_data(glue->core, wlan_data,
- sizeof(*wlan_data));
+ pdev_data->pdata = wlan_data;
+
+ ret = platform_device_add_data(glue->core, pdev_data,
+ sizeof(*pdev_data));
if (ret) {
dev_err(glue->dev, "can't add platform data\n");
goto out_dev_put;
@@ -315,6 +324,9 @@ out_dev_put:
out_free_glue:
kfree(glue);
+out_free_pdev_data:
+ kfree(pdev_data);
+
out:
return ret;
}