mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
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:
parent
70c0b17ee3
commit
e7397e4d3b
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user