0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/module.h>
0009 #include <linux/err.h>
0010 #include <linux/wl12xx.h>
0011
0012 static struct wl1251_platform_data *wl1251_platform_data;
0013
0014 int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
0015 {
0016 if (wl1251_platform_data)
0017 return -EBUSY;
0018 if (!data)
0019 return -EINVAL;
0020
0021 wl1251_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
0022 if (!wl1251_platform_data)
0023 return -ENOMEM;
0024
0025 return 0;
0026 }
0027
0028 struct wl1251_platform_data *wl1251_get_platform_data(void)
0029 {
0030 if (!wl1251_platform_data)
0031 return ERR_PTR(-ENODEV);
0032
0033 return wl1251_platform_data;
0034 }
0035 EXPORT_SYMBOL(wl1251_get_platform_data);