diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2017-12-30 00:33:04 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-08 16:03:43 +0100 |
commit | e1ca114100b2b1409193eacc83fd12992eb4be23 (patch) | |
tree | 5a4ed604ca0f0d4c21d5462a3000362b42a61bdb /drivers/iio/humidity/hts221_i2c.c | |
parent | iio:pressure:bmp280: Read calibration data in probe (diff) | |
download | linux-e1ca114100b2b1409193eacc83fd12992eb4be23.tar.xz linux-e1ca114100b2b1409193eacc83fd12992eb4be23.zip |
iio: humidity: hts221: move common code in hts221_core
Move duplicated i2c/spi probe code in hts221_probe()
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/humidity/hts221_i2c.c')
-rw-r--r-- | drivers/iio/humidity/hts221_i2c.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/iio/humidity/hts221_i2c.c b/drivers/iio/humidity/hts221_i2c.c index f38e4b7e0160..2c97350a0f76 100644 --- a/drivers/iio/humidity/hts221_i2c.c +++ b/drivers/iio/humidity/hts221_i2c.c @@ -66,22 +66,8 @@ static const struct hts221_transfer_function hts221_transfer_fn = { static int hts221_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct hts221_hw *hw; - struct iio_dev *iio_dev; - - iio_dev = devm_iio_device_alloc(&client->dev, sizeof(*hw)); - if (!iio_dev) - return -ENOMEM; - - i2c_set_clientdata(client, iio_dev); - - hw = iio_priv(iio_dev); - hw->name = client->name; - hw->dev = &client->dev; - hw->irq = client->irq; - hw->tf = &hts221_transfer_fn; - - return hts221_probe(iio_dev); + return hts221_probe(&client->dev, client->irq, + client->name, &hts221_transfer_fn); } static const struct acpi_device_id hts221_acpi_match[] = { |