summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore/spi.c
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2013-01-23 16:40:36 +0200
committerLuciano Coelho <coelho@ti.com>2013-02-08 10:05:02 +0200
commit91147a6cd0f599e1e2f5a904c37d73df58f9508f (patch)
tree77cc07673252d5105a3567df2de1b383c710e070 /drivers/net/wireless/ti/wlcore/spi.c
parentafb43e6d88e587441c960a5d214d2c698d076c9c (diff)
downloadblackbird-op-linux-91147a6cd0f599e1e2f5a904c37d73df58f9508f.tar.gz
blackbird-op-linux-91147a6cd0f599e1e2f5a904c37d73df58f9508f.zip
wlcore: use wl12xx_platform_data pointer from wlcore_pdev_data
Just a small cleanup to use the pointer provided by wlcore_pdev_data instead of using a separate pointer then copying. Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/spi.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/spi.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index d437f4d28bd0..d62a20b99190 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -327,23 +327,23 @@ static struct wl1271_if_operations spi_ops = {
static int wl1271_probe(struct spi_device *spi)
{
struct wl12xx_spi_glue *glue;
- struct wl12xx_platform_data *pdata;
struct wlcore_platdev_data *pdev_data;
struct resource res[1];
int ret = -ENOMEM;
- pdata = spi->dev.platform_data;
- if (!pdata) {
- dev_err(&spi->dev, "no platform data\n");
- return -ENODEV;
- }
-
pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
if (!pdev_data) {
dev_err(&spi->dev, "can't allocate platdev_data\n");
goto out;
}
+ pdev_data->pdata = spi->dev.platform_data;
+ if (!pdev_data->pdata) {
+ dev_err(&spi->dev, "no platform data\n");
+ ret = -ENODEV;
+ goto out_free_pdev_data;
+ }
+
pdev_data->if_ops = &spi_ops;
glue = kzalloc(sizeof(*glue), GFP_KERNEL);
@@ -387,8 +387,6 @@ static int wl1271_probe(struct spi_device *spi)
goto out_dev_put;
}
- pdev_data->pdata = pdata;
-
ret = platform_device_add_data(glue->core, pdev_data,
sizeof(*pdev_data));
if (ret) {
OpenPOWER on IntegriCloud