Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / net / wireless / ti / wilink_platform_data.c
blob1de6a62d526f3163428745c326e71a1a88a89bda
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * This file is part of wl12xx
5 * Copyright (C) 2010-2011 Texas Instruments, Inc.
6 */
8 #include <linux/module.h>
9 #include <linux/err.h>
10 #include <linux/wl12xx.h>
12 static struct wl1251_platform_data *wl1251_platform_data;
14 int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
16 if (wl1251_platform_data)
17 return -EBUSY;
18 if (!data)
19 return -EINVAL;
21 wl1251_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
22 if (!wl1251_platform_data)
23 return -ENOMEM;
25 return 0;
28 struct wl1251_platform_data *wl1251_get_platform_data(void)
30 if (!wl1251_platform_data)
31 return ERR_PTR(-ENODEV);
33 return wl1251_platform_data;
35 EXPORT_SYMBOL(wl1251_get_platform_data);