bcm53xx: add BCM5301X patches sent upstream (bus and R6250 LEDs)
[openwrt.git] / target / linux / bcm53xx / patches-3.14 / 400-mtd-move-support-for-struct-flash_platform_data-into.patch
1 --- a/drivers/mtd/spi-nor/spi-nor.c
2 +++ b/drivers/mtd/spi-nor/spi-nor.c
3 @@ -915,7 +915,6 @@ int spi_nor_scan(struct spi_nor *nor, co
4                         enum read_mode mode)
5  {
6         struct flash_info               *info;
7 -       struct flash_platform_data      *data;
8         struct device *dev = nor->dev;
9         struct mtd_info *mtd = nor->mtd;
10         struct device_node *np = dev->of_node;
11 @@ -926,28 +925,6 @@ int spi_nor_scan(struct spi_nor *nor, co
12         if (ret)
13                 return ret;
14  
15 -       /* Platform data helps sort out which chip type we have, as
16 -        * well as how this board partitions it.  If we don't have
17 -        * a chip ID, try the JEDEC id commands; they'll work for most
18 -        * newer chips, even if we don't recognize the particular chip.
19 -        */
20 -       data = dev_get_platdata(dev);
21 -       if (data && data->type) {
22 -               const struct spi_device_id *plat_id;
23 -
24 -               for (i = 0; i < ARRAY_SIZE(spi_nor_ids) - 1; i++) {
25 -                       plat_id = &spi_nor_ids[i];
26 -                       if (strcmp(data->type, plat_id->name))
27 -                               continue;
28 -                       break;
29 -               }
30 -
31 -               if (i < ARRAY_SIZE(spi_nor_ids) - 1)
32 -                       id = plat_id;
33 -               else
34 -                       dev_warn(dev, "unrecognized id %s\n", data->type);
35 -       }
36 -
37         info = (void *)id->driver_data;
38  
39         if (info->jedec_id) {
40 @@ -985,11 +962,8 @@ int spi_nor_scan(struct spi_nor *nor, co
41                 write_sr(nor, 0);
42         }
43  
44 -       if (data && data->name)
45 -               mtd->name = data->name;
46 -       else
47 +       if (!mtd->name)
48                 mtd->name = dev_name(dev);
49 -
50         mtd->type = MTD_NORFLASH;
51         mtd->writesize = 1;
52         mtd->flags = MTD_CAP_NORFLASH;