diff options
Diffstat (limited to 'drivers/iio/light/bh1780.c')
-rw-r--r-- | drivers/iio/light/bh1780.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/iio/light/bh1780.c b/drivers/iio/light/bh1780.c index 72b364e4aa72..b54dcba05a82 100644 --- a/drivers/iio/light/bh1780.c +++ b/drivers/iio/light/bh1780.c | |||
@@ -84,7 +84,7 @@ static int bh1780_debugfs_reg_access(struct iio_dev *indio_dev, | |||
84 | int ret; | 84 | int ret; |
85 | 85 | ||
86 | if (!readval) | 86 | if (!readval) |
87 | bh1780_write(bh1780, (u8)reg, (u8)writeval); | 87 | return bh1780_write(bh1780, (u8)reg, (u8)writeval); |
88 | 88 | ||
89 | ret = bh1780_read(bh1780, (u8)reg); | 89 | ret = bh1780_read(bh1780, (u8)reg); |
90 | if (ret < 0) | 90 | if (ret < 0) |
@@ -187,7 +187,7 @@ static int bh1780_probe(struct i2c_client *client, | |||
187 | 187 | ||
188 | indio_dev->dev.parent = &client->dev; | 188 | indio_dev->dev.parent = &client->dev; |
189 | indio_dev->info = &bh1780_info; | 189 | indio_dev->info = &bh1780_info; |
190 | indio_dev->name = id->name; | 190 | indio_dev->name = "bh1780"; |
191 | indio_dev->channels = bh1780_channels; | 191 | indio_dev->channels = bh1780_channels; |
192 | indio_dev->num_channels = ARRAY_SIZE(bh1780_channels); | 192 | indio_dev->num_channels = ARRAY_SIZE(bh1780_channels); |
193 | indio_dev->modes = INDIO_DIRECT_MODE; | 193 | indio_dev->modes = INDIO_DIRECT_MODE; |
@@ -226,7 +226,8 @@ static int bh1780_remove(struct i2c_client *client) | |||
226 | static int bh1780_runtime_suspend(struct device *dev) | 226 | static int bh1780_runtime_suspend(struct device *dev) |
227 | { | 227 | { |
228 | struct i2c_client *client = to_i2c_client(dev); | 228 | struct i2c_client *client = to_i2c_client(dev); |
229 | struct bh1780_data *bh1780 = i2c_get_clientdata(client); | 229 | struct iio_dev *indio_dev = i2c_get_clientdata(client); |
230 | struct bh1780_data *bh1780 = iio_priv(indio_dev); | ||
230 | int ret; | 231 | int ret; |
231 | 232 | ||
232 | ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF); | 233 | ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF); |
@@ -241,7 +242,8 @@ static int bh1780_runtime_suspend(struct device *dev) | |||
241 | static int bh1780_runtime_resume(struct device *dev) | 242 | static int bh1780_runtime_resume(struct device *dev) |
242 | { | 243 | { |
243 | struct i2c_client *client = to_i2c_client(dev); | 244 | struct i2c_client *client = to_i2c_client(dev); |
244 | struct bh1780_data *bh1780 = i2c_get_clientdata(client); | 245 | struct iio_dev *indio_dev = i2c_get_clientdata(client); |
246 | struct bh1780_data *bh1780 = iio_priv(indio_dev); | ||
245 | int ret; | 247 | int ret; |
246 | 248 | ||
247 | ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_PON); | 249 | ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_PON); |