compat-wireless: fix use of device_create
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 5 Apr 2010 21:03:30 +0000 (23:03 +0200)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 5 Apr 2010 21:22:48 +0000 (14:22 -0700)
The signature of device_create changed in the last kernel version.
Backporting it in compat is hard because of the use of var args.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
patches/25-device_create.patch [new file with mode: 0644]

diff --git a/patches/25-device_create.patch b/patches/25-device_create.patch
new file mode 100644 (file)
index 0000000..232816e
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -1211,8 +1211,17 @@ static int __init init_mac80211_hwsim(vo
+               data = hw->priv;
+               data->hw = hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
+               data->dev = device_create(hwsim_class, NULL, 0, hw,
+                                         "hwsim%d", i);
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
++              data->dev = device_create_drvdata(hwsim_class, NULL, 0, hw,
++                                        "hwsim%d", i);
++#else
++              data->dev = device_create(hwsim_class, NULL, 0,
++                                        "hwsim%d", i);
++              dev_set_drvdata(data->dev, hw);
++#endif
+               if (IS_ERR(data->dev)) {
+                       printk(KERN_DEBUG
+                              "mac80211_hwsim: device_create "