Message ID | 20211031142130.20791-8-lars@metafoo.de (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [1/9] iio: interrupt-trigger: Remove no-op trigger ops | expand |
On Sun, Oct 31, 2021 at 3:21 PM Lars-Peter Clausen <lars@metafoo.de> wrote: > The IIO core handles a trigger ops with all NULL callbacks the > same as if the trigger ops itself was NULL. > > Remove the empty trigger ops from the interrupt trigger driver to slightly > reduce the boilerplate code. Object size of the driver module is also > slightly reduced. > > Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c index d1d9f2d319e4..b820041159f7 100644 --- a/drivers/iio/light/gp2ap020a00f.c +++ b/drivers/iio/light/gp2ap020a00f.c @@ -1467,9 +1467,6 @@ static const struct iio_buffer_setup_ops gp2ap020a00f_buffer_setup_ops = { .predisable = &gp2ap020a00f_buffer_predisable, }; -static const struct iio_trigger_ops gp2ap020a00f_trigger_ops = { -}; - static int gp2ap020a00f_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -1550,8 +1547,6 @@ static int gp2ap020a00f_probe(struct i2c_client *client, goto error_uninit_buffer; } - data->trig->ops = &gp2ap020a00f_trigger_ops; - init_irq_work(&data->work, gp2ap020a00f_iio_trigger_work); err = iio_trigger_register(data->trig);
The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> --- drivers/iio/light/gp2ap020a00f.c | 5 ----- 1 file changed, 5 deletions(-)