Luciano Coelho | b2ba99f | 2011-11-20 23:32:10 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of wl1271 |
| 3 | * |
| 4 | * Copyright (C) 2008-2010 Nokia Corporation |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * version 2 as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 18 | * 02110-1301 USA |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <linux/module.h> |
| 23 | #include <linux/platform_device.h> |
| 24 | |
Luciano Coelho | ffeb501 | 2011-11-21 18:55:51 +0200 | [diff] [blame^] | 25 | #include <linux/err.h> |
| 26 | |
Luciano Coelho | b2ba99f | 2011-11-20 23:32:10 +0200 | [diff] [blame] | 27 | #include "../wlcore/wlcore.h" |
Luciano Coelho | ffeb501 | 2011-11-21 18:55:51 +0200 | [diff] [blame^] | 28 | #include "../wlcore/debug.h" |
| 29 | |
| 30 | static int __devinit wl12xx_probe(struct platform_device *pdev) |
| 31 | { |
| 32 | struct wl1271 *wl; |
| 33 | struct ieee80211_hw *hw; |
| 34 | |
| 35 | hw = wlcore_alloc_hw(); |
| 36 | if (IS_ERR(hw)) { |
| 37 | wl1271_error("can't allocate hw"); |
| 38 | return PTR_ERR(hw); |
| 39 | } |
| 40 | |
| 41 | wl = hw->priv; |
| 42 | |
| 43 | return wlcore_probe(wl, pdev); |
| 44 | } |
Luciano Coelho | b2ba99f | 2011-11-20 23:32:10 +0200 | [diff] [blame] | 45 | |
| 46 | static const struct platform_device_id wl12xx_id_table[] __devinitconst = { |
| 47 | { "wl12xx", 0 }, |
| 48 | { } /* Terminating Entry */ |
| 49 | }; |
| 50 | MODULE_DEVICE_TABLE(platform, wl12xx_id_table); |
| 51 | |
| 52 | static struct platform_driver wl12xx_driver = { |
Luciano Coelho | ffeb501 | 2011-11-21 18:55:51 +0200 | [diff] [blame^] | 53 | .probe = wl12xx_probe, |
Luciano Coelho | b2ba99f | 2011-11-20 23:32:10 +0200 | [diff] [blame] | 54 | .remove = __devexit_p(wlcore_remove), |
| 55 | .id_table = wl12xx_id_table, |
| 56 | .driver = { |
| 57 | .name = "wl12xx_driver", |
| 58 | .owner = THIS_MODULE, |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | static int __init wl12xx_init(void) |
| 63 | { |
| 64 | return platform_driver_register(&wl12xx_driver); |
| 65 | } |
| 66 | module_init(wl12xx_init); |
| 67 | |
| 68 | static void __exit wl12xx_exit(void) |
| 69 | { |
| 70 | platform_driver_unregister(&wl12xx_driver); |
| 71 | } |
| 72 | module_exit(wl12xx_exit); |
| 73 | |
| 74 | MODULE_LICENSE("GPL v2"); |
| 75 | MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); |