Unverified Commit e7397e4d authored by Marius Trifu's avatar Marius Trifu Committed by Mark Brown
Browse files

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: default avatarMarius Trifu <marius.trifu@nxp.com>
Signed-off-by: default avatarLarisa Grigore <larisa.grigore@nxp.com>
Signed-off-by: default avatarJames Clark <james.clark@linaro.org>
Link: https://patch.msgid.link/20250522-james-nxp-spi-v2-7-bea884630cfb@linaro.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 70c0b17e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1366,6 +1366,9 @@ static int dspi_probe(struct platform_device *pdev)
	if (!dspi)
		return -ENOMEM;

	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");