Skip to content

Commit 8ffef79

Browse files
committed
firewire: ohci: use from_work() macro to expand parent structure of work_struct
A commit 60b2ebf ("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/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
1 parent 088eb0f commit 8ffef79

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/firewire/ohci.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ static void context_tasklet(unsigned long data)
11901190

11911191
static void ohci_isoc_context_work(struct work_struct *work)
11921192
{
1193-
struct fw_iso_context *base = container_of(work, struct fw_iso_context, work);
1193+
struct fw_iso_context *base = from_work(base, work, work);
11941194
struct iso_context *isoc_ctx = container_of(base, struct iso_context, base);
11951195

11961196
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)
20282028

20292029
static void bus_reset_work(struct work_struct *work)
20302030
{
2031-
struct fw_ohci *ohci =
2032-
container_of(work, struct fw_ohci, bus_reset_work);
2031+
struct fw_ohci *ohci = from_work(ohci, work, bus_reset_work);
20332032
int self_id_count, generation, new_generation, i, j;
20342033
u32 reg, quadlet;
20352034
void *free_rom = NULL;

0 commit comments

Comments
 (0)