This source file includes following definitions.
- wl1251_set_platform_data
- wl1251_get_platform_data
1
2
3
4
5
6
7
8 #include <linux/module.h>
9 #include <linux/err.h>
10 #include <linux/wl12xx.h>
11
12 static struct wl1251_platform_data *wl1251_platform_data;
13
14 int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
15 {
16 if (wl1251_platform_data)
17 return -EBUSY;
18 if (!data)
19 return -EINVAL;
20
21 wl1251_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
22 if (!wl1251_platform_data)
23 return -ENOMEM;
24
25 return 0;
26 }
27
28 struct wl1251_platform_data *wl1251_get_platform_data(void)
29 {
30 if (!wl1251_platform_data)
31 return ERR_PTR(-ENODEV);
32
33 return wl1251_platform_data;
34 }
35 EXPORT_SYMBOL(wl1251_get_platform_data);