Re: [PATCH] mtd: mchp23k256: Use SPI match data for chip caps
From: Miquel Raynal
Date: Wed Jun 24 2026 - 03:30:33 EST
On 24/06/2026 at 13:54:40 +08, Pengpeng Hou <pengpeng@xxxxxxxxxxx> wrote:
> The driver stores chip capacity information in both the OF match table
> and the SPI id table. Probe currently uses of_device_get_match_data(),
> so a non-OF SPI modalias match falls back to mchp23k256_caps even when
> the SPI id table selected a different part.
>
> Use spi_get_device_match_data() so SPI id-table driver_data is consumed
> when OF match data is absent. This keeps the existing default fallback
> while avoiding the wrong MTD geometry for id-table-only matches.
>
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
> ---
I am not sure the default makes a lot of sense as there are only two
possible hits and both have private data attached. Nevertheless, the fix
looks correct.
Thanks,
Miquèl