backports: remove usage of members of struct property for kernel < 2.6.39
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 1 Jan 2014 20:33:49 +0000 (21:33 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 18 Jan 2014 12:42:36 +0000 (13:42 +0100)
struct property is missing in the general header files in older kernel
versions. There are different versions of this header depending on the
architecture code in use. This removed the access to any members of
struct property for older kernel version when CONFIG_OF is not set.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
patches/collateral-evolutions/network/82-struct_property_missing/INFO [new file with mode: 0644]
patches/collateral-evolutions/network/82-struct_property_missing/mwifiex.patch [new file with mode: 0644]

diff --git a/patches/collateral-evolutions/network/82-struct_property_missing/INFO b/patches/collateral-evolutions/network/82-struct_property_missing/INFO
new file mode 100644 (file)
index 0000000..b3e0ced
--- /dev/null
@@ -0,0 +1,4 @@
+struct property is missing in the general header files in older kernel 
+versions. There are different versions of this header depending on the 
+architecture code in use. This removed the access to any members of 
+struct property
diff --git a/patches/collateral-evolutions/network/82-struct_property_missing/mwifiex.patch b/patches/collateral-evolutions/network/82-struct_property_missing/mwifiex.patch
new file mode 100644 (file)
index 0000000..d3712db
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/drivers/net/wireless/mwifiex/sta_cmd.c
++++ b/drivers/net/wireless/mwifiex/sta_cmd.c
+@@ -25,6 +25,7 @@
+ #include "wmm.h"
+ #include "11n.h"
+ #include "11ac.h"
++#include <linux/of.h>
+ /*
+  * This function prepares command to set/get RSSI information.
+@@ -1194,6 +1195,7 @@ static int mwifiex_cmd_cfg_data(struct m
+       int ret;
+       if (prop) {
++#if defined(CONFIG_OF) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
+               len = prop->length;
+               ret = of_property_read_u8_array(adapter->dt_node, prop->name,
+                                               data, len);
+@@ -1201,6 +1203,9 @@ static int mwifiex_cmd_cfg_data(struct m
+                       return ret;
+               dev_dbg(adapter->dev,
+                       "download cfg_data from device tree: %s\n", prop->name);
++#else
++              return -1;
++#endif
+       } else if (adapter->cal_data->data && adapter->cal_data->size > 0) {
+               len = mwifiex_parse_cal_cfg((u8 *)adapter->cal_data->data,
+                                           adapter->cal_data->size, data);