[1/2] iio: Improve the kernel-doc of iio_trigger_poll
Commit Message
Move the kernel-doc of the function to industrialio-trigger.c
Add a note on the context where the function is expected to be called.
Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com>
---
drivers/iio/industrialio-trigger.c | 7 +++++++
include/linux/iio/trigger.h | 6 ------
2 files changed, 7 insertions(+), 6 deletions(-)
Comments
On Mon, Feb 27, 2023 at 07:00:38PM +0100, Mehdi Djait wrote:
> Move the kernel-doc of the function to industrialio-trigger.c
> Add a note on the context where the function is expected to be called.
...
> + * This function needs to be called from an interrupt context.
> - * Typically called in relevant hardware interrupt handler.
These are not equivalent. Can you explain in the commit message why we move
from hardware to any interrupt context?
Hello Andy,
On Tue, Feb 28, 2023 at 12:50:06AM +0200, Andy Shevchenko wrote:
> On Mon, Feb 27, 2023 at 07:00:38PM +0100, Mehdi Djait wrote:
> > Move the kernel-doc of the function to industrialio-trigger.c
> > Add a note on the context where the function is expected to be called.
>
> ...
>
> > + * This function needs to be called from an interrupt context.
>
> > - * Typically called in relevant hardware interrupt handler.
>
> These are not equivalent. Can you explain in the commit message why we move
> from hardware to any interrupt context?
I read the definition of handle_irq_desc more carefully and [1]. I will
change it to hard IRQ context.
I got confused by the kernel-docs under /kernel/irq/irqdesc.c as it states
that the function must be called from an IRQ context for generic_handle_irq
but explicitly states hard IRQ context for another funtion.
[1] https://lore.kernel.org/all/1346922337-17088-1-git-send-email-lars@metafoo.de/
--
Kind Regards
Mehdi Djait
@@ -192,6 +192,13 @@ static void iio_trigger_notify_done_atomic(struct iio_trigger *trig)
schedule_work(&trig->reenable_work);
}
+/**
+ * iio_trigger_poll() - Call the IRQ trigger handler of the consumers
+ * @trig: trigger which occurred
+ *
+ * This function needs to be called from an interrupt context.
+ *
+ */
void iio_trigger_poll(struct iio_trigger *trig)
{
int i;
@@ -151,12 +151,6 @@ void iio_trigger_unregister(struct iio_trigger *trig_info);
**/
int iio_trigger_set_immutable(struct iio_dev *indio_dev, struct iio_trigger *trig);
-/**
- * iio_trigger_poll() - called on a trigger occurring
- * @trig: trigger which occurred
- *
- * Typically called in relevant hardware interrupt handler.
- **/
void iio_trigger_poll(struct iio_trigger *trig);
void iio_trigger_poll_chained(struct iio_trigger *trig);