]> git.baikalelectronics.ru Git - kernel.git/commit
iio: trigger: move trig->owner init to trigger allocate() stage
authorDmitry Rokosov <DDRokosov@sberdevices.ru>
Wed, 1 Jun 2022 17:48:32 +0000 (17:48 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 16 Jul 2022 15:24:19 +0000 (16:24 +0100)
commit5743a39e170ab4d3177b633065044368670be3b2
tree9c13d5002bc85e7b06aba7414bdf4a52501ce71d
parentbcc1fce9d65d24e7243d80ac530e95ab9c0f2dae
iio: trigger: move trig->owner init to trigger allocate() stage

To provide a new IIO trigger to the IIO core, usually driver executes the
following pipeline: allocate()/register()/get(). Before, IIO core assigned
trig->owner as a pointer to the module which registered this trigger at
the register() stage. But actually the trigger object is owned by the
module earlier, on the allocate() stage, when trigger object is
successfully allocated for the driver.

This patch moves trig->owner initialization from register()
stage of trigger initialization pipeline to allocate() stage to
eliminate all misunderstandings and time gaps between trigger object
creation and owner acquiring.

Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Link: https://lore.kernel.org/r/20220601174837.20292-1-ddrokosov@sberdevices.ru
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-trigger.c
include/linux/iio/iio.h
include/linux/iio/trigger.h