-+ if ((list = of_get_property(np, "ath,eep-flash", &i)) && i == 2 *
-+ sizeof(*list) && (phandle = be32_to_cpup(list++)) &&
-+ (mtd_np = of_find_node_by_phandle(phandle)) && ((part =
-+ of_get_property(mtd_np, "label", NULL)) || (part =
-+ mtd_np->name)) && (the_mtd = get_mtd_device_nm(part))
-+ != ERR_PTR(-ENODEV)) {
-+ i = mtd_read(the_mtd, be32_to_cpup(list),
-+ ATH9K_PLAT_EEP_MAX_WORDS << 1, &flash_readlen,
-+ (void *) ath9k_pdata.eeprom_data);
-+ if (!of_property_read_u32(np, "ath,mac-offset", &mac_offset)) {
-+ size_t mac_readlen;
-+ mtd_read(the_mtd, mac_offset, 6, &mac_readlen,
-+ (void *) athxk_eeprom_mac);
-+ }
-+ put_mtd_device(the_mtd);
-+ if ((sizeof(ath9k_pdata.eeprom_data) != flash_readlen) || i) {
-+ dev_err(&pdev->dev, "failed to load eeprom from mtd\n");
-+ return -ENODEV;
-+ }
-+ } else {
-+ eep_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ mac_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-+
-+ if (!eep_res) {
-+ dev_err(&pdev->dev, "failed to load eeprom address\n");
-+ return -ENODEV;
-+ }
-+ if (resource_size(eep_res) != ATH9K_PLAT_EEP_MAX_WORDS << 1) {
-+ dev_err(&pdev->dev, "eeprom has an invalid size\n");
-+ return -EINVAL;
-+ }
-+
-+ eep = ioremap(eep_res->start, resource_size(eep_res));
-+ memcpy_fromio(ath9k_pdata.eeprom_data, eep,
-+ ATH9K_PLAT_EEP_MAX_WORDS << 1);
++ list = of_get_property(np, "ath,eep-flash", &i);
++ if (!list || (i != (2 * sizeof(*list))))
++ return -ENODEV;
++
++ phandle = be32_to_cpup(list++);
++ if (phandle)
++ mtd_np = of_find_node_by_phandle(phandle);
++
++ if (!mtd_np)
++ return -ENODEV;
++
++ part = of_get_property(mtd_np, "label", NULL);
++ if (!part)
++ part = mtd_np->name;
++
++ the_mtd = get_mtd_device_nm(part);
++ if (IS_ERR(the_mtd))
++ return -ENODEV;
++
++ i = mtd_read(the_mtd, be32_to_cpup(list), ATH9K_PLAT_EEP_MAX_WORDS << 1,
++ &flash_readlen, (void *) ath9k_pdata.eeprom_data);
++
++ if (!of_property_read_u32(np, "ath,mac-offset", &mac_offset)) {
++ size_t mac_readlen;
++ mtd_read(the_mtd, mac_offset, 6, &mac_readlen,
++ (void *) athxk_eeprom_mac);
++ }
++ put_mtd_device(the_mtd);
++
++ if ((sizeof(ath9k_pdata.eeprom_data) != flash_readlen) || i) {
++ dev_err(&pdev->dev, "failed to load eeprom from mtd\n");
++ return -ENODEV;