diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-01-01 09:17:05 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-01-04 02:48:33 -0500 |
commit | 693a50b511818e07a131efc944cba1a504b63d3d (patch) | |
tree | f2791e96a50e10ec07223a9aa3b0719768221ca8 /drivers/firewire/ohci.c | |
parent | 386a4153a2c1455e424f280d636efa3c91864466 (diff) |
firewire: ohci: consolidate context status flags
"firewire: ohci: restart iso DMA contexts on resume from low power mode"
added the flag struct context.active and "firewire: ohci: cache the
context run bit" added struct context.running.
These flags contain the same information; combine them.
Also, normalize whitespace in pci_resume().
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r-- | drivers/firewire/ohci.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 3ae84e2c5192..d77d120ddc25 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -156,7 +156,6 @@ struct context { | |||
156 | descriptor_callback_t callback; | 156 | descriptor_callback_t callback; |
157 | 157 | ||
158 | struct tasklet_struct tasklet; | 158 | struct tasklet_struct tasklet; |
159 | bool active; | ||
160 | }; | 159 | }; |
161 | 160 | ||
162 | #define IT_HEADER_SY(v) ((v) << 0) | 161 | #define IT_HEADER_SY(v) ((v) << 0) |
@@ -1169,7 +1168,6 @@ static struct descriptor *context_get_descriptors(struct context *ctx, | |||
1169 | static void context_run(struct context *ctx, u32 extra) | 1168 | static void context_run(struct context *ctx, u32 extra) |
1170 | { | 1169 | { |
1171 | struct fw_ohci *ohci = ctx->ohci; | 1170 | struct fw_ohci *ohci = ctx->ohci; |
1172 | ctx->active = true; | ||
1173 | 1171 | ||
1174 | reg_write(ohci, COMMAND_PTR(ctx->regs), | 1172 | reg_write(ohci, COMMAND_PTR(ctx->regs), |
1175 | le32_to_cpu(ctx->last->branch_address)); | 1173 | le32_to_cpu(ctx->last->branch_address)); |
@@ -1202,7 +1200,6 @@ static void context_stop(struct context *ctx) | |||
1202 | u32 reg; | 1200 | u32 reg; |
1203 | int i; | 1201 | int i; |
1204 | 1202 | ||
1205 | ctx->active = false; | ||
1206 | reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); | 1203 | reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); |
1207 | ctx->running = false; | 1204 | ctx->running = false; |
1208 | flush_writes(ctx->ohci); | 1205 | flush_writes(ctx->ohci); |
@@ -2797,13 +2794,13 @@ static void ohci_resume_iso_dma(struct fw_ohci *ohci) | |||
2797 | 2794 | ||
2798 | for (i = 0 ; i < ohci->n_ir ; i++) { | 2795 | for (i = 0 ; i < ohci->n_ir ; i++) { |
2799 | ctx = &ohci->ir_context_list[i]; | 2796 | ctx = &ohci->ir_context_list[i]; |
2800 | if (ctx->context.active) | 2797 | if (ctx->context.running) |
2801 | ohci_start_iso(&ctx->base, 0, ctx->sync, ctx->tags); | 2798 | ohci_start_iso(&ctx->base, 0, ctx->sync, ctx->tags); |
2802 | } | 2799 | } |
2803 | 2800 | ||
2804 | for (i = 0 ; i < ohci->n_it ; i++) { | 2801 | for (i = 0 ; i < ohci->n_it ; i++) { |
2805 | ctx = &ohci->it_context_list[i]; | 2802 | ctx = &ohci->it_context_list[i]; |
2806 | if (ctx->context.active) | 2803 | if (ctx->context.running) |
2807 | ohci_start_iso(&ctx->base, 0, ctx->sync, ctx->tags); | 2804 | ohci_start_iso(&ctx->base, 0, ctx->sync, ctx->tags); |
2808 | } | 2805 | } |
2809 | } | 2806 | } |
@@ -3363,11 +3360,11 @@ static int pci_resume(struct pci_dev *dev) | |||
3363 | } | 3360 | } |
3364 | 3361 | ||
3365 | err = ohci_enable(&ohci->card, NULL, 0); | 3362 | err = ohci_enable(&ohci->card, NULL, 0); |
3366 | |||
3367 | if (err) | 3363 | if (err) |
3368 | return err; | 3364 | return err; |
3369 | 3365 | ||
3370 | ohci_resume_iso_dma(ohci); | 3366 | ohci_resume_iso_dma(ohci); |
3367 | |||
3371 | return 0; | 3368 | return 0; |
3372 | } | 3369 | } |
3373 | #endif | 3370 | #endif |