diff options
-rw-r--r-- | drivers/ieee1394/csr.h | 10 | ||||
-rw-r--r-- | drivers/ieee1394/hosts.c | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ieee1394/csr.h b/drivers/ieee1394/csr.h index f11546550d84..90fb3f2192c3 100644 --- a/drivers/ieee1394/csr.h +++ b/drivers/ieee1394/csr.h | |||
@@ -50,11 +50,11 @@ | |||
50 | #define CSR_MAX_ROM_SHIFT 8 | 50 | #define CSR_MAX_ROM_SHIFT 8 |
51 | #define CSR_GENERATION_SHIFT 4 | 51 | #define CSR_GENERATION_SHIFT 4 |
52 | 52 | ||
53 | #define CSR_SET_BUS_INFO_GENERATION(csr, gen) \ | 53 | static inline void csr_set_bus_info_generation(struct csr1212_csr *csr, u8 gen) |
54 | ((csr)->bus_info_data[2] = \ | 54 | { |
55 | cpu_to_be32((be32_to_cpu((csr)->bus_info_data[2]) & \ | 55 | csr->bus_info_data[2] &= ~cpu_to_be32(0xf << CSR_GENERATION_SHIFT); |
56 | ~(0xf << CSR_GENERATION_SHIFT)) | \ | 56 | csr->bus_info_data[2] |= cpu_to_be32((u32)gen << CSR_GENERATION_SHIFT); |
57 | (gen) << CSR_GENERATION_SHIFT)) | 57 | } |
58 | 58 | ||
59 | struct csr_control { | 59 | struct csr_control { |
60 | spinlock_t lock; | 60 | spinlock_t lock; |
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index 237d0c9d69c6..e947d8ffac85 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c | |||
@@ -34,18 +34,18 @@ static void delayed_reset_bus(struct work_struct *work) | |||
34 | { | 34 | { |
35 | struct hpsb_host *host = | 35 | struct hpsb_host *host = |
36 | container_of(work, struct hpsb_host, delayed_reset.work); | 36 | container_of(work, struct hpsb_host, delayed_reset.work); |
37 | int generation = host->csr.generation + 1; | 37 | u8 generation = host->csr.generation + 1; |
38 | 38 | ||
39 | /* The generation field rolls over to 2 rather than 0 per IEEE | 39 | /* The generation field rolls over to 2 rather than 0 per IEEE |
40 | * 1394a-2000. */ | 40 | * 1394a-2000. */ |
41 | if (generation > 0xf || generation < 2) | 41 | if (generation > 0xf || generation < 2) |
42 | generation = 2; | 42 | generation = 2; |
43 | 43 | ||
44 | CSR_SET_BUS_INFO_GENERATION(host->csr.rom, generation); | 44 | csr_set_bus_info_generation(host->csr.rom, generation); |
45 | if (csr1212_generate_csr_image(host->csr.rom) != CSR1212_SUCCESS) { | 45 | if (csr1212_generate_csr_image(host->csr.rom) != CSR1212_SUCCESS) { |
46 | /* CSR image creation failed. | 46 | /* CSR image creation failed. |
47 | * Reset generation field and do not issue a bus reset. */ | 47 | * Reset generation field and do not issue a bus reset. */ |
48 | CSR_SET_BUS_INFO_GENERATION(host->csr.rom, | 48 | csr_set_bus_info_generation(host->csr.rom, |
49 | host->csr.generation); | 49 | host->csr.generation); |
50 | return; | 50 | return; |
51 | } | 51 | } |