spi: spi-fsl-dspi: Use spi_alloc_target for target

spi_alloc_target should be used for target devices. This also sets
ctlr->target automatically so delete that line.

Signed-off-by: Marius Trifu <marius.trifu@nxp.com>
Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com>
Signed-off-by: James Clark <james.clark@linaro.org>
Link: https://patch.msgid.link/20250522-james-nxp-spi-v2-7-bea884630cfb@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Marius Trifu 2025-05-22 15:51:36 +01:00 committed by Mark Brown
parent 70c0b17ee3
commit e7397e4d3b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -1366,7 +1366,10 @@ static int dspi_probe(struct platform_device *pdev)
if (!dspi)
return -ENOMEM;
ctlr = spi_alloc_host(&pdev->dev, 0);
if (of_property_read_bool(np, "spi-slave"))
ctlr = spi_alloc_target(&pdev->dev, 0);
else
ctlr = spi_alloc_host(&pdev->dev, 0);
if (!ctlr)
return -ENOMEM;
@ -1405,9 +1408,6 @@ static int dspi_probe(struct platform_device *pdev)
of_property_read_u32(np, "bus-num", &bus_num);
ctlr->bus_num = bus_num;
if (of_property_read_bool(np, "spi-slave"))
ctlr->target = true;
dspi->devtype_data = of_device_get_match_data(&pdev->dev);
if (!dspi->devtype_data) {
dev_err(&pdev->dev, "can't get devtype_data\n");