Skip to content

Commit e7397e4

Browse files
Marius Trifubroonie
authored andcommitted
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>
1 parent 70c0b17 commit e7397e4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/spi/spi-fsl-dspi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,10 @@ static int dspi_probe(struct platform_device *pdev)
13661366
if (!dspi)
13671367
return -ENOMEM;
13681368

1369-
ctlr = spi_alloc_host(&pdev->dev, 0);
1369+
if (of_property_read_bool(np, "spi-slave"))
1370+
ctlr = spi_alloc_target(&pdev->dev, 0);
1371+
else
1372+
ctlr = spi_alloc_host(&pdev->dev, 0);
13701373
if (!ctlr)
13711374
return -ENOMEM;
13721375

@@ -1405,9 +1408,6 @@ static int dspi_probe(struct platform_device *pdev)
14051408
of_property_read_u32(np, "bus-num", &bus_num);
14061409
ctlr->bus_num = bus_num;
14071410

1408-
if (of_property_read_bool(np, "spi-slave"))
1409-
ctlr->target = true;
1410-
14111411
dspi->devtype_data = of_device_get_match_data(&pdev->dev);
14121412
if (!dspi->devtype_data) {
14131413
dev_err(&pdev->dev, "can't get devtype_data\n");

0 commit comments

Comments
 (0)