[PATCH v4] mtd: fsl-quadspi: Distinguish the mtd device names

Boris Brezillon boris.brezillon at free-electrons.com
Thu Jan 11 12:15:43 PST 2018

On Thu, 11 Jan 2018 14:58:39 -0200
Fabio Estevam <festevam at gmail.com> wrote:

> On Thu, Jan 11, 2018 at 2:40 PM, Boris Brezillon
> <boris.brezillon at free-electrons.com> wrote:
> > Nope, I wasn't sure whether reg was mandatory or not since it was not
> > used by the driver before your patch. This being said, that'd be good to
> > update the example you have in the bindings do to fully describe a
> > flash device.  
> Ok, I can update fsl-quadspi.txt to include an example for describing
> the flash devices.
> > Anyway, if all existing DTs have a reg defined, even those where only  
> As far as I can see all DTs that use fsl-quadspi have a reg property
> in the SPI flash sub-nodes:
> arch/arm/boot/dts/imx6ul-14x14-evk.dts
> arch/arm/boot/dts/imx6sx-sdb.dts
> arch/arm/boot/dts/ls1021a-moxa-uc-8410a.dts
> arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts
> > one flash device is described, then your patch might break mtdparts
> > users. And if this is not the case, and the reg property is really
> > mandatory, then that means those dts are not compliant with the DT
> > bindings and have to be patched :-). So, the solution of testing the
> > presence of a reg property to choose the naming scheme is probably not
> > appropriate.  
> Any ideas on how we can properly solve this?

Nothing that I really like, sorry. One solution would be to use
dev_name(&pdev->dev) when only one flash device is declared and use
dev_name(&pdev->dev)-reg_val otherwise. Or you could leave the logic
unchanged and force users to specify a label property when they have
more than one device. The last solution would be to actually break
mtdparts users so that you can start using a sane naming scheme.

More information about the linux-mtd mailing list