Skip to contentSkip to conversation

iio:max1361: Use default triggered buffer setup ops

PATCH In review Lars-Peter Clausen 2 participants 2 messages Sep 16, 2013 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio:max1361: Use default triggered buffer setup ops

The max1361 driver uses the same callbacks as the triggered buffer default buffer setup ops, so just remove the max1361 specific ops and let it use the default ops.

---
 drivers/iio/adc/max1363.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/iio/adc/max1363.c +1 -7
index 4fb35d1..1e7160d 100644
@@ -1484,12 +1484,6 @@ done:
 	return IRQ_HANDLED;
 }
 
-static const struct iio_buffer_setup_ops max1363_buffered_setup_ops = {
-	.postenable = &iio_triggered_buffer_postenable,
-	.preenable = &iio_sw_buffer_preenable,
-	.predisable = &iio_triggered_buffer_predisable,
-};
-
 static int max1363_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
 {
@@ -1559,7 +1553,7 @@ static int max1363_probe(struct i2c_client *client,
 		goto error_disable_reg;
 
 	ret = iio_triggered_buffer_setup(indio_dev, NULL,
-		&max1363_trigger_handler, &max1363_buffered_setup_ops);
+		&max1363_trigger_handler, NULL);
 	if (ret)
 		goto error_disable_reg;
 
Signature · 1 line
1.8.0
maintainer
#1 lore raw
Quoted 5 lines · Lars-Peter Clausen

The max1361 driver uses the same callbacks as the triggered buffer default buffer setup ops, so just remove the max1361 specific ops and let it use the default ops.

Thanks. Applied to the togreg branch of ii

Quoted 31 lines
---
 drivers/iio/adc/max1363.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/iio/adc/max1363.c +1 -7
index 4fb35d1..1e7160d 100644
@@ -1484,12 +1484,6 @@ done:
 	return IRQ_HANDLED;
 }
 
-static const struct iio_buffer_setup_ops max1363_buffered_setup_ops = {
-	.postenable = &iio_triggered_buffer_postenable,
-	.preenable = &iio_sw_buffer_preenable,
-	.predisable = &iio_triggered_buffer_predisable,
-};
-
 static int max1363_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
 {
@@ -1559,7 +1553,7 @@ static int max1363_probe(struct i2c_client *client,
 		goto error_disable_reg;
 
 	ret = iio_triggered_buffer_setup(indio_dev, NULL,
-		&max1363_trigger_handler, &max1363_buffered_setup_ops);
+		&max1363_trigger_handler, NULL);
 	if (ret)
 		goto error_disable_reg;