Re: [PATCH 2/2] spi: airoha: add support for AN7589

From: Mark Brown

Date: Fri Dec 04 2026 - 11:43:49 EST


> The AN7589 NFI takes a 36 bit DMA address: the upper 4 bits go into a
> second register at 0x88. Add match data with the width of the DMA
> address, use it for the DMA mask and write the upper register only on
> the AN7589, so the EN7581 and EN7523 never touch an offset they do not
> document.

> @@ -1073,6 +1106,7 @@ static int airoha_snand_probe(struct platform_device *pdev)
>
> as_ctrl = spi_controller_get_devdata(ctrl);
> as_ctrl->dev = dev;
> + as_ctrl->data = device_get_match_data(dev);

We should really check this...

> @@ -1114,7 +1148,8 @@ static int airoha_snand_probe(struct platform_device *pdev)
> }
> }
>
> - err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
> + err = dma_set_mask(as_ctrl->dev,
> + DMA_BIT_MASK(as_ctrl->data->dma_addr_bits));
> if (err)
> return err;
>

...because we deference it unconditionally here.

--
Mark Brown <broonie@xxxxxxxxxx>