|
@@ -226,7 +226,8 @@ static int bh1780_remove(struct i2c_client *client)
|
|
static int bh1780_runtime_suspend(struct device *dev)
|
|
static int bh1780_runtime_suspend(struct device *dev)
|
|
{
|
|
{
|
|
struct i2c_client *client = to_i2c_client(dev);
|
|
struct i2c_client *client = to_i2c_client(dev);
|
|
- struct bh1780_data *bh1780 = i2c_get_clientdata(client);
|
|
|
|
|
|
+ struct iio_dev *indio_dev = i2c_get_clientdata(client);
|
|
|
|
+ struct bh1780_data *bh1780 = iio_priv(indio_dev);
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF);
|
|
ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF);
|
|
@@ -241,7 +242,8 @@ static int bh1780_runtime_suspend(struct device *dev)
|
|
static int bh1780_runtime_resume(struct device *dev)
|
|
static int bh1780_runtime_resume(struct device *dev)
|
|
{
|
|
{
|
|
struct i2c_client *client = to_i2c_client(dev);
|
|
struct i2c_client *client = to_i2c_client(dev);
|
|
- struct bh1780_data *bh1780 = i2c_get_clientdata(client);
|
|
|
|
|
|
+ struct iio_dev *indio_dev = i2c_get_clientdata(client);
|
|
|
|
+ struct bh1780_data *bh1780 = iio_priv(indio_dev);
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_PON);
|
|
ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_PON);
|