packages: clean up the package folder
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 614-rt2x00-of_load_eeprom_filename.patch
1 --- a/drivers/net/wireless/rt2x00/rt2800pci.c
2 +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
3 @@ -39,6 +39,7 @@
4 #include <linux/pci.h>
5 #include <linux/platform_device.h>
6 #include <linux/eeprom_93cx6.h>
7 +#include <linux/of.h>
8
9 #include "rt2x00.h"
10 #include "rt2x00mmio.h"
11 @@ -323,11 +324,17 @@ static int rt2800pci_write_firmware(stru
12 static char *rt2800pci_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
13 {
14 struct rt2x00_platform_data *pdata;
15 + struct device_node *np;
16 + char *eep;
17
18 pdata = rt2x00dev->dev->platform_data;
19 if (pdata)
20 return pdata->eeprom_file_name;
21
22 + np = rt2x00dev->dev->of_node;
23 + if (np && !of_property_read_string(np, "ralink,eeprom", &eep))
24 + return eep;
25 +
26 return NULL;
27 }
28