mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-25 03:55:09 +08:00
a390e85cfe
Move all common parts from sdio.c and spi.c to main.c, since they now can be handled as part of the platform driver. Signed-off-by: Felipe Balbi <balbi@ti.com> [forward-ported, cleaned-up and rephrased commit message] [added a bunch of fixes and a new pdata element] [moved some new code into main.c as well] Signed-off-by: Luciano Coelho <coelho@ti.com>
29 lines
565 B
C
29 lines
565 B
C
#include <linux/module.h>
|
|
#include <linux/err.h>
|
|
#include <linux/wl12xx.h>
|
|
|
|
static struct wl12xx_platform_data *platform_data;
|
|
|
|
int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
|
|
{
|
|
if (platform_data)
|
|
return -EBUSY;
|
|
if (!data)
|
|
return -EINVAL;
|
|
|
|
platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
|
|
if (!platform_data)
|
|
return -ENOMEM;
|
|
|
|
return 0;
|
|
}
|
|
|
|
struct wl12xx_platform_data *wl12xx_get_platform_data(void)
|
|
{
|
|
if (!platform_data)
|
|
return ERR_PTR(-ENODEV);
|
|
|
|
return platform_data;
|
|
}
|
|
EXPORT_SYMBOL(wl12xx_get_platform_data);
|