aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/pci_msi.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2011-01-22 06:32:20 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-16 21:19:03 -0400
commit44ed3c0c47906297924c3fde801dc160f6996f7c (patch)
treef11b2de6fd33842c7aadd8cafdfbd136b56bfed6 /arch/sparc/kernel/pci_msi.c
parentfe41493f749797f516deb84ba07747fb7d8c04c1 (diff)
sparc64: rename virt_irq => irq - II
The generic irq support uses the term 'irq' for the allocated irq number. Fix it so sparc64 use the same term for an irq as the generic irq support does. For a naive reader this is less confusing. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/pci_msi.c')
-rw-r--r--arch/sparc/kernel/pci_msi.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c
index b210416ace7b..550e937720e7 100644
--- a/arch/sparc/kernel/pci_msi.c
+++ b/arch/sparc/kernel/pci_msi.c
@@ -31,12 +31,12 @@ static irqreturn_t sparc64_msiq_interrupt(int irq, void *cookie)
31 err = ops->dequeue_msi(pbm, msiqid, &head, &msi); 31 err = ops->dequeue_msi(pbm, msiqid, &head, &msi);
32 if (likely(err > 0)) { 32 if (likely(err > 0)) {
33 struct irq_desc *desc; 33 struct irq_desc *desc;
34 unsigned int virt_irq; 34 unsigned int irq;
35 35
36 virt_irq = pbm->msi_irq_table[msi - pbm->msi_first]; 36 irq = pbm->msi_irq_table[msi - pbm->msi_first];
37 desc = irq_desc + virt_irq; 37 desc = irq_desc + irq;
38 38
39 desc->handle_irq(virt_irq, desc); 39 desc->handle_irq(irq, desc);
40 } 40 }
41 41
42 if (unlikely(err < 0)) 42 if (unlikely(err < 0))
@@ -121,7 +121,7 @@ static struct irq_chip msi_irq = {
121 /* XXX affinity XXX */ 121 /* XXX affinity XXX */
122}; 122};
123 123
124static int sparc64_setup_msi_irq(unsigned int *virt_irq_p, 124static int sparc64_setup_msi_irq(unsigned int *irq_p,
125 struct pci_dev *pdev, 125 struct pci_dev *pdev,
126 struct msi_desc *entry) 126 struct msi_desc *entry)
127{ 127{
@@ -131,17 +131,17 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
131 int msi, err; 131 int msi, err;
132 u32 msiqid; 132 u32 msiqid;
133 133
134 *virt_irq_p = virt_irq_alloc(0, 0); 134 *irq_p = irq_alloc(0, 0);
135 err = -ENOMEM; 135 err = -ENOMEM;
136 if (!*virt_irq_p) 136 if (!*irq_p)
137 goto out_err; 137 goto out_err;
138 138
139 set_irq_chip_and_handler_name(*virt_irq_p, &msi_irq, 139 set_irq_chip_and_handler_name(*irq_p, &msi_irq,
140 handle_simple_irq, "MSI"); 140 handle_simple_irq, "MSI");
141 141
142 err = alloc_msi(pbm); 142 err = alloc_msi(pbm);
143 if (unlikely(err < 0)) 143 if (unlikely(err < 0))
144 goto out_virt_irq_free; 144 goto out_irq_free;
145 145
146 msi = err; 146 msi = err;
147 147
@@ -152,7 +152,7 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
152 if (err) 152 if (err)
153 goto out_msi_free; 153 goto out_msi_free;
154 154
155 pbm->msi_irq_table[msi - pbm->msi_first] = *virt_irq_p; 155 pbm->msi_irq_table[msi - pbm->msi_first] = *irq_p;
156 156
157 if (entry->msi_attrib.is_64) { 157 if (entry->msi_attrib.is_64) {
158 msg.address_hi = pbm->msi64_start >> 32; 158 msg.address_hi = pbm->msi64_start >> 32;
@@ -163,24 +163,24 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
163 } 163 }
164 msg.data = msi; 164 msg.data = msi;
165 165
166 set_irq_msi(*virt_irq_p, entry); 166 set_irq_msi(*irq_p, entry);
167 write_msi_msg(*virt_irq_p, &msg); 167 write_msi_msg(*irq_p, &msg);
168 168
169 return 0; 169 return 0;
170 170
171out_msi_free: 171out_msi_free:
172 free_msi(pbm, msi); 172 free_msi(pbm, msi);
173 173
174out_virt_irq_free: 174out_irq_free:
175 set_irq_chip(*virt_irq_p, NULL); 175 set_irq_chip(*irq_p, NULL);
176 virt_irq_free(*virt_irq_p); 176 irq_free(*irq_p);
177 *virt_irq_p = 0; 177 *irq_p = 0;
178 178
179out_err: 179out_err:
180 return err; 180 return err;
181} 181}
182 182
183static void sparc64_teardown_msi_irq(unsigned int virt_irq, 183static void sparc64_teardown_msi_irq(unsigned int irq,
184 struct pci_dev *pdev) 184 struct pci_dev *pdev)
185{ 185{
186 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; 186 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
@@ -189,12 +189,12 @@ static void sparc64_teardown_msi_irq(unsigned int virt_irq,
189 int i, err; 189 int i, err;
190 190
191 for (i = 0; i < pbm->msi_num; i++) { 191 for (i = 0; i < pbm->msi_num; i++) {
192 if (pbm->msi_irq_table[i] == virt_irq) 192 if (pbm->msi_irq_table[i] == irq)
193 break; 193 break;
194 } 194 }
195 if (i >= pbm->msi_num) { 195 if (i >= pbm->msi_num) {
196 printk(KERN_ERR "%s: teardown: No MSI for irq %u\n", 196 printk(KERN_ERR "%s: teardown: No MSI for irq %u\n",
197 pbm->name, virt_irq); 197 pbm->name, irq);
198 return; 198 return;
199 } 199 }
200 200
@@ -205,14 +205,14 @@ static void sparc64_teardown_msi_irq(unsigned int virt_irq,
205 if (err) { 205 if (err) {
206 printk(KERN_ERR "%s: teardown: ops->teardown() on MSI %u, " 206 printk(KERN_ERR "%s: teardown: ops->teardown() on MSI %u, "
207 "irq %u, gives error %d\n", 207 "irq %u, gives error %d\n",
208 pbm->name, msi_num, virt_irq, err); 208 pbm->name, msi_num, irq, err);
209 return; 209 return;
210 } 210 }
211 211
212 free_msi(pbm, msi_num); 212 free_msi(pbm, msi_num);
213 213
214 set_irq_chip(virt_irq, NULL); 214 set_irq_chip(irq, NULL);
215 virt_irq_free(virt_irq); 215 irq_free(irq);
216} 216}
217 217
218static int msi_bitmap_alloc(struct pci_pbm_info *pbm) 218static int msi_bitmap_alloc(struct pci_pbm_info *pbm)