diff options
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/accel/lis3l02dq_ring.c | 6 | ||||
-rw-r--r-- | drivers/staging/iio/adc/mxs-lradc.c | 4 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7758_trigger.c | 6 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 8 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/iio-trig-gpio.c | 6 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | 12 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/iio-trig-sysfs.c | 4 |
7 files changed, 23 insertions, 23 deletions
diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c index e676403..5b8f0f6 100644 --- a/drivers/staging/iio/accel/lis3l02dq_ring.c +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c @@ -228,7 +228,7 @@ error_ret: static int lis3l02dq_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state) { - struct iio_dev *indio_dev = trig->private_data; + struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); int ret = 0; u8 t; @@ -252,7 +252,7 @@ static int lis3l02dq_data_rdy_trigger_set_state(struct iio_trigger *trig, */ static int lis3l02dq_trig_try_reen(struct iio_trigger *trig) { - struct iio_dev *indio_dev = trig->private_data; + struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); struct lis3l02dq_state *st = iio_priv(indio_dev); int i; @@ -290,7 +290,7 @@ int lis3l02dq_probe_trigger(struct iio_dev *indio_dev) st->trig->dev.parent = &st->us->dev; st->trig->ops = &lis3l02dq_trigger_ops; - st->trig->private_data = indio_dev; + iio_trigger_set_drvdata(st->trig, indio_dev); ret = iio_trigger_register(st->trig); if (ret) goto error_free_trig; diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 25a4359..eab975d 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -646,7 +646,7 @@ static irqreturn_t mxs_lradc_trigger_handler(int irq, void *p) static int mxs_lradc_configure_trigger(struct iio_trigger *trig, bool state) { - struct iio_dev *iio = trig->private_data; + struct iio_dev *iio = iio_trigger_get_drvdata(trig); struct mxs_lradc *lradc = iio_priv(iio); const uint32_t st = state ? STMP_OFFSET_REG_SET : STMP_OFFSET_REG_CLR; @@ -670,7 +670,7 @@ static int mxs_lradc_trigger_init(struct iio_dev *iio) return -ENOMEM; trig->dev.parent = iio->dev.parent; - trig->private_data = iio; + iio_trigger_set_drvdata(trig, iio); trig->ops = &mxs_lradc_trigger_ops; ret = iio_trigger_register(trig); diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c index f9c6a34..7a94ddd 100644 --- a/drivers/staging/iio/meter/ade7758_trigger.c +++ b/drivers/staging/iio/meter/ade7758_trigger.c @@ -32,7 +32,7 @@ static irqreturn_t ade7758_data_rdy_trig_poll(int irq, void *private) static int ade7758_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state) { - struct iio_dev *indio_dev = trig->private_data; + struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); dev_dbg(&indio_dev->dev, "%s (%d)\n", __func__, state); return ade7758_set_irq(&indio_dev->dev, state); @@ -44,7 +44,7 @@ static int ade7758_data_rdy_trigger_set_state(struct iio_trigger *trig, **/ static int ade7758_trig_try_reen(struct iio_trigger *trig) { - struct iio_dev *indio_dev = trig->private_data; + struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); struct ade7758_state *st = iio_priv(indio_dev); enable_irq(st->us->irq); @@ -81,7 +81,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) st->trig->dev.parent = &st->us->dev; st->trig->ops = &ade7758_trigger_ops; - st->trig->private_data = indio_dev; + iio_trigger_set_drvdata(st->trig, indio_dev); ret = iio_trigger_register(st->trig); /* select default trigger */ diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c index 42798da..38a158b 100644 --- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c +++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c @@ -65,7 +65,7 @@ struct bfin_tmr_state { static int iio_bfin_tmr_set_state(struct iio_trigger *trig, bool state) { - struct bfin_tmr_state *st = trig->private_data; + struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig); if (get_gptimer_period(st->t->id) == 0) return -EINVAL; @@ -82,7 +82,7 @@ static ssize_t iio_bfin_tmr_frequency_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct iio_trigger *trig = to_iio_trigger(dev); - struct bfin_tmr_state *st = trig->private_data; + struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig); unsigned long val; bool enabled; int ret; @@ -125,7 +125,7 @@ static ssize_t iio_bfin_tmr_frequency_show(struct device *dev, char *buf) { struct iio_trigger *trig = to_iio_trigger(dev); - struct bfin_tmr_state *st = trig->private_data; + struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig); unsigned int period = get_gptimer_period(st->t->id); unsigned long val; @@ -213,9 +213,9 @@ static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev) goto out1; } - st->trig->private_data = st; st->trig->ops = &iio_bfin_tmr_trigger_ops; st->trig->dev.groups = iio_bfin_tmr_trigger_attr_groups; + iio_trigger_set_drvdata(st->trig, st); ret = iio_trigger_register(st->trig); if (ret) goto out2; diff --git a/drivers/staging/iio/trigger/iio-trig-gpio.c b/drivers/staging/iio/trigger/iio-trig-gpio.c index fcc4cb0..7c593d1 100644 --- a/drivers/staging/iio/trigger/iio-trig-gpio.c +++ b/drivers/staging/iio/trigger/iio-trig-gpio.c @@ -83,7 +83,7 @@ static int iio_gpio_trigger_probe(struct platform_device *pdev) ret = -ENOMEM; goto error_put_trigger; } - trig->private_data = trig_info; + iio_trigger_set_drvdata(trig, trig_info); trig_info->irq = irq; trig->ops = &iio_gpio_trigger_ops; ret = request_irq(irq, iio_gpio_trigger_poll, @@ -121,7 +121,7 @@ error_free_completed_registrations: trig2, &iio_gpio_trigger_list, alloc_list) { - trig_info = trig->private_data; + trig_info = iio_trigger_get_drvdata(trig); free_irq(gpio_to_irq(trig_info->irq), trig); kfree(trig_info); iio_trigger_unregister(trig); @@ -140,7 +140,7 @@ static int iio_gpio_trigger_remove(struct platform_device *pdev) trig2, &iio_gpio_trigger_list, alloc_list) { - trig_info = trig->private_data; + trig_info = iio_trigger_get_drvdata(trig); iio_trigger_unregister(trig); free_irq(trig_info->irq, trig); kfree(trig_info); diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c index 9102b1b..7969597 100644 --- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c +++ b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c @@ -30,7 +30,7 @@ struct iio_prtc_trigger_info { static int iio_trig_periodic_rtc_set_state(struct iio_trigger *trig, bool state) { - struct iio_prtc_trigger_info *trig_info = trig->private_data; + struct iio_prtc_trigger_info *trig_info = iio_trigger_get_drvdata(trig); if (trig_info->frequency == 0) return -EINVAL; printk(KERN_INFO "trigger frequency is %d\n", trig_info->frequency); @@ -42,7 +42,7 @@ static ssize_t iio_trig_periodic_read_freq(struct device *dev, char *buf) { struct iio_trigger *trig = to_iio_trigger(dev); - struct iio_prtc_trigger_info *trig_info = trig->private_data; + struct iio_prtc_trigger_info *trig_info = iio_trigger_get_drvdata(trig); return sprintf(buf, "%u\n", trig_info->frequency); } @@ -52,7 +52,7 @@ static ssize_t iio_trig_periodic_write_freq(struct device *dev, size_t len) { struct iio_trigger *trig = to_iio_trigger(dev); - struct iio_prtc_trigger_info *trig_info = trig->private_data; + struct iio_prtc_trigger_info *trig_info = iio_trigger_get_drvdata(trig); unsigned long val; int ret; @@ -124,7 +124,7 @@ static int iio_trig_periodic_rtc_probe(struct platform_device *dev) ret = -ENOMEM; goto error_put_trigger_and_remove_from_list; } - trig->private_data = trig_info; + iio_trigger_set_drvdata(trig, trig_info); trig->ops = &iio_prtc_trigger_ops; /* RTC access */ trig_info->rtc @@ -158,7 +158,7 @@ error_free_completed_registrations: trig2, &iio_prtc_trigger_list, alloc_list) { - trig_info = trig->private_data; + trig_info = iio_trigger_get_drvdata(trig); rtc_irq_unregister(trig_info->rtc, &trig_info->task); rtc_class_close(trig_info->rtc); kfree(trig_info); @@ -176,7 +176,7 @@ static int iio_trig_periodic_rtc_remove(struct platform_device *dev) trig2, &iio_prtc_trigger_list, alloc_list) { - trig_info = trig->private_data; + trig_info = iio_trigger_get_drvdata(trig); rtc_irq_unregister(trig_info->rtc, &trig_info->task); rtc_class_close(trig_info->rtc); kfree(trig_info); diff --git a/drivers/staging/iio/trigger/iio-trig-sysfs.c b/drivers/staging/iio/trigger/iio-trig-sysfs.c index 3bac972..b727bde 100644 --- a/drivers/staging/iio/trigger/iio-trig-sysfs.c +++ b/drivers/staging/iio/trigger/iio-trig-sysfs.c @@ -103,7 +103,7 @@ static ssize_t iio_sysfs_trigger_poll(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct iio_trigger *trig = to_iio_trigger(dev); - struct iio_sysfs_trig *sysfs_trig = trig->private_data; + struct iio_sysfs_trig *sysfs_trig = iio_trigger_get_drvdata(trig); irq_work_queue(&sysfs_trig->work); @@ -160,7 +160,7 @@ static int iio_sysfs_trigger_probe(int id) t->trig->dev.groups = iio_sysfs_trigger_attr_groups; t->trig->ops = &iio_sysfs_trigger_ops; t->trig->dev.parent = &iio_sysfs_trig_dev; - t->trig->private_data = t; + iio_trigger_set_drvdata(t->trig, t); init_irq_work(&t->work, iio_sysfs_trigger_work); |