Thread (17 messages) 17 messages, 4 authors, 2014-10-22
STALE4242d

[PATCH v2 3/5] spi-nor: Make spi_nor_scan() take a chip type name, not an spi_device_id

From: zajec5@gmail.com (Rafał Miłecki)
Date: 2014-09-30 05:14:15

On 30 September 2014 04:15, Ben Hutchings [off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help