]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firewire: ohci: use from_work() macro to expand parent structure of work_struct
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 8 Jun 2025 23:38:07 +0000 (08:38 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 8 Jun 2025 23:45:20 +0000 (08:45 +0900)
A commit 60b2ebf48526 ("workqueue: Introduce from_work() helper for cleaner
callback declarations") introduces a new macro to retrieve a poiner for the
parent structure of the work item. It is convenient to reduce input text.

This commit uses the macro in PCI driver for 1394 OHCI.

Link: https://lore.kernel.org/r/20250608233808.202355-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/ohci.c

index 27e3e998e6fc76e580863935df9c54a11be18934..40313a3ec63eba59d5d133afeeb85ba424797c89 100644 (file)
@@ -1190,7 +1190,7 @@ static void context_tasklet(unsigned long data)
 
 static void ohci_isoc_context_work(struct work_struct *work)
 {
-       struct fw_iso_context *base = container_of(work, struct fw_iso_context, work);
+       struct fw_iso_context *base = from_work(base, work, work);
        struct iso_context *isoc_ctx = container_of(base, struct iso_context, base);
 
        context_retire_descriptors(&isoc_ctx->context);
@@ -2028,8 +2028,7 @@ static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count)
 
 static void bus_reset_work(struct work_struct *work)
 {
-       struct fw_ohci *ohci =
-               container_of(work, struct fw_ohci, bus_reset_work);
+       struct fw_ohci *ohci = from_work(ohci, work, bus_reset_work);
        int self_id_count, generation, new_generation, i, j;
        u32 reg, quadlet;
        void *free_rom = NULL;