remarkable-linux/drivers/mtd/devices
Brian Norris de57732da8 mtd: m25p80: fix module autoloading for "jedec, spi-nor" and "spi-nor"
Commit 4316302292 ("mtd: m25p80: allow arbitrary OF matching for
"jedec,spi-nor"") moved the "jedec,spi-nor" handling from the
spi_device_id table to the of_match_table, to better handle matching
complex device tree compatible strings. With that patch, device tree
support works as expected when m25p80.c is built into the kernel.

However, that commit ignored the fact that:

 (1) (non-DT) platform devices might want to use the "spi-nor" string
     for matching with this driver, rather than picking an arbitrary one
     like "m25p80"
 (2) the core SPI uevent/modalias code doesn't yet support kernel module
     autoloading via of_match_table strings; so for DT-based devices, it
     will only report (part of) the first compatible string used

Problem (1) has been reported previously, and I forgot to patch it up
afterward.

Problem (2) was noticed recently here:
http://lists.infradead.org/pipermail/linux-mtd/2015-October/062369.html
https://lkml.org/lkml/2015/11/12/574

Specifically, this patch fixes m25p80.ko module autoloading for cases
like this:

	flash@xxx {
		compatible = "jedec,spi-nor";
		...
	};

because modalias of "spi:spi-nor" (the only module loading info provided
by the SPI core for this device) will now be listed as an alias in
m25p80.ko.

Notably, it does *not* help cases like this:

	flash@xxx {
		compatible = "vendor,shiny-new-device", "jedec,spi-nor";
		...
	};

unless we also list "shiny-new-device" in m25p_ids[]. There has been
discussion on future work for this issue here:
https://lkml.org/lkml/2015/11/12/574

Cc: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
2015-11-19 16:46:42 -08:00
..
bcm47xxsflash.c mtd: devices: bcm47xxflash: show parent device in sysfs 2015-10-13 09:21:14 -07:00
bcm47xxsflash.h
block2mtd.c writeback: separate out include/linux/backing-dev-defs.h 2015-06-02 08:33:34 -06:00
docg3.c mtd: docg3: off by one in doc_register_sysfs() 2015-10-26 11:45:30 -07:00
docg3.h
Kconfig mtd: powernv: Add powernv flash MTD abstraction driver 2015-06-11 13:23:30 +10:00
lart.c
m25p80.c mtd: m25p80: fix module autoloading for "jedec, spi-nor" and "spi-nor" 2015-11-19 16:46:42 -08:00
Makefile mtd: powernv: Add powernv flash MTD abstraction driver 2015-06-11 13:23:30 +10:00
ms02-nv.c
ms02-nv.h
mtd_dataflash.c Linux 4.4-rc1 2015-11-15 20:31:29 -08:00
mtdram.c mtd: mtdram: check offs and len in mtdram->erase 2015-10-19 18:08:33 -07:00
phram.c mtd: phram: fix asm/io.h include usage 2014-10-22 01:59:30 -07:00
pmc551.c mtd: delete unnecessary checks before two function calls 2014-11-25 22:44:10 -08:00
powernv_flash.c mtd: powernv: Add powernv flash MTD abstraction driver 2015-06-11 13:23:30 +10:00
serial_flash_cmds.h
slram.c arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead 2015-08-10 23:07:05 -04:00
spear_smi.c mtd: drop unnecessary partition parser data 2015-11-11 13:58:59 -08:00
sst25l.c MTD updates for 4.4-rc1: 2015-11-06 11:50:24 -08:00
st_spi_fsm.c mtd: drop unnecessary partition parser data 2015-11-11 13:58:59 -08:00