[PATCH v4] mtd: fsl-quadspi: Distinguish the mtd device names
Boris Brezillon
boris.brezillon at free-electrons.com
Thu Jan 11 08:40:12 PST 2018
On Thu, 11 Jan 2018 13:59:44 -0200
Fabio Estevam <festevam at gmail.com> wrote:
> Hi Boris,
>
> On Thu, Jan 11, 2018 at 1:48 PM, Boris Brezillon
> <boris.brezillon at free-electrons.com> wrote:
>
> > Still missing the DT doc update. You can do it in a separate patch, but
> > please make it part of the same series.
>
> The dt-binding update part is not very clear to me.
>
> Currently on the imx6sx-sdb.dts we have:
>
> &qspi2 {
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_qspi2>;
> status = "okay";
>
> flash0: n25q256a at 0 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "micron,n25q256a", "jedec,spi-nor";
> spi-max-frequency = <29000000>;
> reg = <0>;
> };
>
> flash1: n25q256a at 1 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "micron,n25q256a", "jedec,spi-nor";
> spi-max-frequency = <29000000>;
> reg = <1>;
> };
> };
>
>
> The reg requirement is already present as part of
> Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt.
>
> Are you proposing that I add a comment to
> Documentation/devicetree/bindings/mtd/fsl-quadspi.txt saying that the
> Flash sub-nodes must contain a reg property?
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.
Anyway, if all existing DTs have a reg defined, even those where only
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.
More information about the linux-mtd
mailing list