Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 382a4777 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron
Browse files

staging:iio:ad7606: Move set_drvdata() into common code



Both the platform_device and SPI driver call set_drvdata() at the end of
their probe function. Move this into the common probe() function to reduce
duplicated code.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 91b7334b
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -517,6 +517,8 @@ struct iio_dev *ad7606_probe(struct device *dev, int irq,
	if (ret)
	if (ret)
		goto error_unregister_ring;
		goto error_unregister_ring;


	dev_set_drvdata(dev, indio_dev);

	return indio_dev;
	return indio_dev;
error_unregister_ring:
error_unregister_ring:
	ad7606_ring_cleanup(indio_dev);
	ad7606_ring_cleanup(indio_dev);
+0 −2
Original line number Original line Diff line number Diff line
@@ -77,8 +77,6 @@ static int ad7606_par_probe(struct platform_device *pdev)
	if (IS_ERR(indio_dev))
	if (IS_ERR(indio_dev))
		return PTR_ERR(indio_dev);
		return PTR_ERR(indio_dev);


	platform_set_drvdata(pdev, indio_dev);

	return 0;
	return 0;
}
}


+0 −2
Original line number Original line Diff line number Diff line
@@ -52,8 +52,6 @@ static int ad7606_spi_probe(struct spi_device *spi)
	if (IS_ERR(indio_dev))
	if (IS_ERR(indio_dev))
		return PTR_ERR(indio_dev);
		return PTR_ERR(indio_dev);


	spi_set_drvdata(spi, indio_dev);

	return 0;
	return 0;
}
}