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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
if (ret)
goto error_unregister_ring;
+ dev_set_drvdata(dev, indio_dev);
+
return indio_dev;
error_unregister_ring:
ad7606_ring_cleanup(indio_dev);
if (IS_ERR(indio_dev))
return PTR_ERR(indio_dev);
- platform_set_drvdata(pdev, indio_dev);
-
return 0;
}
if (IS_ERR(indio_dev))
return PTR_ERR(indio_dev);
- spi_set_drvdata(spi, indio_dev);
-
return 0;
}