Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 946651cb authored by Luciano Coelho's avatar Luciano Coelho Committed by John W. Linville
Browse files

wl1251: split wl251 platform data to a separate structure



Move the wl1251 part of the wl12xx platform data structure into a new
structure specifically for wl1251.  Change the platform data built-in
block and board files accordingly.

Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
Reviewed-by: default avatarSebastian Reichel <sre@debian.org>
Reviewed-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ef1b4141
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -536,7 +536,7 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {

static void __init pandora_wl1251_init(void)
{
	struct wl12xx_platform_data pandora_wl1251_pdata;
	struct wl1251_platform_data pandora_wl1251_pdata;
	int ret;

	memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata));
@@ -550,7 +550,7 @@ static void __init pandora_wl1251_init(void)
		goto fail_irq;

	pandora_wl1251_pdata.use_eeprom = true;
	ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
	ret = wl1251_set_platform_data(&pandora_wl1251_pdata);
	if (ret < 0)
		goto fail_irq;

+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ enum {
	RX51_SPI_MIPID,		/* LCD panel */
};

static struct wl12xx_platform_data wl1251_pdata;
static struct wl1251_platform_data wl1251_pdata;
static struct tsc2005_platform_data tsc2005_pdata;

#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
+31 −6
Original line number Diff line number Diff line
@@ -23,17 +23,17 @@
#include <linux/err.h>
#include <linux/wl12xx.h>

static struct wl12xx_platform_data *platform_data;
static struct wl12xx_platform_data *wl12xx_platform_data;

int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
{
	if (platform_data)
	if (wl12xx_platform_data)
		return -EBUSY;
	if (!data)
		return -EINVAL;

	platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
	if (!platform_data)
	wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
	if (!wl12xx_platform_data)
		return -ENOMEM;

	return 0;
@@ -41,9 +41,34 @@ int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)

struct wl12xx_platform_data *wl12xx_get_platform_data(void)
{
	if (!platform_data)
	if (!wl12xx_platform_data)
		return ERR_PTR(-ENODEV);

	return platform_data;
	return wl12xx_platform_data;
}
EXPORT_SYMBOL(wl12xx_get_platform_data);

static struct wl1251_platform_data *wl1251_platform_data;

int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
{
	if (wl1251_platform_data)
		return -EBUSY;
	if (!data)
		return -EINVAL;

	wl1251_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
	if (!wl1251_platform_data)
		return -ENOMEM;

	return 0;
}

struct wl1251_platform_data *wl1251_get_platform_data(void)
{
	if (!wl1251_platform_data)
		return ERR_PTR(-ENODEV);

	return wl1251_platform_data;
}
EXPORT_SYMBOL(wl1251_get_platform_data);
+6 −6
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,
	struct wl1251 *wl;
	struct ieee80211_hw *hw;
	struct wl1251_sdio *wl_sdio;
	const struct wl12xx_platform_data *wl12xx_board_data;
	const struct wl1251_platform_data *wl1251_board_data;

	hw = wl1251_alloc_hw();
	if (IS_ERR(hw))
@@ -254,11 +254,11 @@ static int wl1251_sdio_probe(struct sdio_func *func,
	wl->if_priv = wl_sdio;
	wl->if_ops = &wl1251_sdio_ops;

	wl12xx_board_data = wl12xx_get_platform_data();
	if (!IS_ERR(wl12xx_board_data)) {
		wl->set_power = wl12xx_board_data->set_power;
		wl->irq = wl12xx_board_data->irq;
		wl->use_eeprom = wl12xx_board_data->use_eeprom;
	wl1251_board_data = wl1251_get_platform_data();
	if (!IS_ERR(wl1251_board_data)) {
		wl->set_power = wl1251_board_data->set_power;
		wl->irq = wl1251_board_data->irq;
		wl->use_eeprom = wl1251_board_data->use_eeprom;
	}

	if (wl->irq) {
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ static const struct wl1251_if_operations wl1251_spi_ops = {

static int wl1251_spi_probe(struct spi_device *spi)
{
	struct wl12xx_platform_data *pdata;
	struct wl1251_platform_data *pdata;
	struct ieee80211_hw *hw;
	struct wl1251 *wl;
	int ret;
Loading