aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio/humidity/hts221_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/humidity/hts221_spi.c')
-rw-r--r--drivers/iio/humidity/hts221_spi.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/iio/humidity/hts221_spi.c b/drivers/iio/humidity/hts221_spi.c
index 57cbc256771b..55b29b53b9d1 100644
--- a/drivers/iio/humidity/hts221_spi.c
+++ b/drivers/iio/humidity/hts221_spi.c
@@ -80,22 +80,8 @@ static const struct hts221_transfer_function hts221_transfer_fn = {
static int hts221_spi_probe(struct spi_device *spi)
{
- struct hts221_hw *hw;
- struct iio_dev *iio_dev;
-
- iio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*hw));
- if (!iio_dev)
- return -ENOMEM;
-
- spi_set_drvdata(spi, iio_dev);
-
- hw = iio_priv(iio_dev);
- hw->name = spi->modalias;
- hw->dev = &spi->dev;
- hw->irq = spi->irq;
- hw->tf = &hts221_transfer_fn;
-
- return hts221_probe(iio_dev);
+ return hts221_probe(&spi->dev, spi->irq,
+ spi->modalias, &hts221_transfer_fn);
}
static const struct of_device_id hts221_spi_of_match[] = {