[PATCH v2 3/5] spi-nor: Make spi_nor_scan() take a chip type name, not an spi_device_id
Rafał Miłecki
zajec5 at gmail.com
Mon Sep 29 22:14:15 PDT 2014
On 30 September 2014 04:15, Ben Hutchings <ben at decadent.org.uk> wrote:
> @@ -236,16 +236,13 @@ static int m25p_probe(struct spi_device *spi)
> * If that's the case, respect "type" and ignore a "name".
> */
> if (data && data->type)
> - id = spi_nor_match_id(data->type);
> + name = data->type;
>
> /* If we didn't get name from platform, simply use "modalias". */
> - if (!id) {
> - id = spi_nor_match_id(spi_get_device_id(spi)->name);
> - if (WARN_ON(!id))
> - return -ENODEV;
> - }
> + if (!name)
> + name = spi_get_device_id(spi)->name;
Huh? Iterating the whole id_table, checking the entries (looking for
one with name equal to the spi->modalias) and then... getting that
name?
Did it hurt to use the patch I've sent
mtd: m25p80: get rid of spi_get_device_id
https://patchwork.ozlabs.org/patch/394328/
More information about the linux-mtd
mailing list