aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Jiang <djiang@mvista.com>2007-07-19 04:50:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:54 -0400
commit36b8289e249f800a57a4c908a9a7e91345f516ef (patch)
tree5b5d2ad62617805823b6eee307f255396886e7f4
parent849a4c375a8e06cd000399dceb25888d356d021f (diff)
drivers/edac: Lindent i3000
Lindent cleanup of i3000_edac driver Signed-off-by: Dave Jiang <djiang@mvista.com> Signed-off-by: Douglas Thompson <dougthompson@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/edac/i3000_edac.c55
1 files changed, 26 insertions, 29 deletions
diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c
index 570925d410a7..c8418fcea254 100644
--- a/drivers/edac/i3000_edac.c
+++ b/drivers/edac/i3000_edac.c
@@ -130,7 +130,6 @@
130 * 30:0 reserved 130 * 30:0 reserved
131 */ 131 */
132 132
133
134enum i3000p_chips { 133enum i3000p_chips {
135 I3000 = 0, 134 I3000 = 0,
136}; 135};
@@ -149,15 +148,14 @@ struct i3000_error_info {
149 148
150static const struct i3000_dev_info i3000_devs[] = { 149static const struct i3000_dev_info i3000_devs[] = {
151 [I3000] = { 150 [I3000] = {
152 .ctl_name = "i3000" 151 .ctl_name = "i3000"},
153 },
154}; 152};
155 153
156static struct pci_dev *mci_pdev = NULL; 154static struct pci_dev *mci_pdev = NULL;
157static int i3000_registered = 1; 155static int i3000_registered = 1;
158 156
159static void i3000_get_error_info(struct mem_ctl_info *mci, 157static void i3000_get_error_info(struct mem_ctl_info *mci,
160 struct i3000_error_info *info) 158 struct i3000_error_info *info)
161{ 159{
162 struct pci_dev *pdev; 160 struct pci_dev *pdev;
163 161
@@ -183,22 +181,21 @@ static void i3000_get_error_info(struct mem_ctl_info *mci,
183 * should be UE info. 181 * should be UE info.
184 */ 182 */
185 if ((info->errsts ^ info->errsts2) & I3000_ERRSTS_BITS) { 183 if ((info->errsts ^ info->errsts2) & I3000_ERRSTS_BITS) {
186 pci_read_config_byte(pdev, I3000_EDEAP, 184 pci_read_config_byte(pdev, I3000_EDEAP, &info->edeap);
187 &info->edeap); 185 pci_read_config_dword(pdev, I3000_DEAP, &info->deap);
188 pci_read_config_dword(pdev, I3000_DEAP, 186 pci_read_config_byte(pdev, I3000_DERRSYN, &info->derrsyn);
189 &info->deap);
190 pci_read_config_byte(pdev, I3000_DERRSYN,
191 &info->derrsyn);
192 } 187 }
193 188
194 /* Clear any error bits. 189 /* Clear any error bits.
195 * (Yes, we really clear bits by writing 1 to them.) 190 * (Yes, we really clear bits by writing 1 to them.)
196 */ 191 */
197 pci_write_bits16(pdev, I3000_ERRSTS, I3000_ERRSTS_BITS, I3000_ERRSTS_BITS); 192 pci_write_bits16(pdev, I3000_ERRSTS, I3000_ERRSTS_BITS,
193 I3000_ERRSTS_BITS);
198} 194}
199 195
200static int i3000_process_error_info(struct mem_ctl_info *mci, 196static int i3000_process_error_info(struct mem_ctl_info *mci,
201 struct i3000_error_info *info, int handle_errors) 197 struct i3000_error_info *info,
198 int handle_errors)
202{ 199{
203 int row, multi_chan; 200 int row, multi_chan;
204 int pfn, offset, channel; 201 int pfn, offset, channel;
@@ -226,8 +223,7 @@ static int i3000_process_error_info(struct mem_ctl_info *mci,
226 edac_mc_handle_ue(mci, pfn, offset, row, "i3000 UE"); 223 edac_mc_handle_ue(mci, pfn, offset, row, "i3000 UE");
227 else 224 else
228 edac_mc_handle_ce(mci, pfn, offset, info->derrsyn, row, 225 edac_mc_handle_ce(mci, pfn, offset, info->derrsyn, row,
229 multi_chan ? channel : 0, 226 multi_chan ? channel : 0, "i3000 CE");
230 "i3000 CE");
231 227
232 return 1; 228 return 1;
233} 229}
@@ -281,18 +277,19 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
281 277
282 debugf0("MC: %s()\n", __func__); 278 debugf0("MC: %s()\n", __func__);
283 279
284 pci_read_config_dword(pdev, I3000_MCHBAR, (u32 *)&mchbar); 280 pci_read_config_dword(pdev, I3000_MCHBAR, (u32 *) & mchbar);
285 mchbar &= I3000_MCHBAR_MASK; 281 mchbar &= I3000_MCHBAR_MASK;
286 window = ioremap_nocache(mchbar, I3000_MMR_WINDOW_SIZE); 282 window = ioremap_nocache(mchbar, I3000_MMR_WINDOW_SIZE);
287 if (!window) { 283 if (!window) {
288 printk(KERN_ERR "i3000: cannot map mmio space at 0x%lx\n", mchbar); 284 printk(KERN_ERR "i3000: cannot map mmio space at 0x%lx\n",
285 mchbar);
289 return -ENODEV; 286 return -ENODEV;
290 } 287 }
291 288
292 c0dra[0] = readb(window + I3000_C0DRA + 0); /* ranks 0,1 */ 289 c0dra[0] = readb(window + I3000_C0DRA + 0); /* ranks 0,1 */
293 c0dra[1] = readb(window + I3000_C0DRA + 1); /* ranks 2,3 */ 290 c0dra[1] = readb(window + I3000_C0DRA + 1); /* ranks 2,3 */
294 c1dra[0] = readb(window + I3000_C1DRA + 0); /* ranks 0,1 */ 291 c1dra[0] = readb(window + I3000_C1DRA + 0); /* ranks 0,1 */
295 c1dra[1] = readb(window + I3000_C1DRA + 1); /* ranks 2,3 */ 292 c1dra[1] = readb(window + I3000_C1DRA + 1); /* ranks 2,3 */
296 293
297 for (i = 0; i < I3000_RANKS_PER_CHANNEL; i++) { 294 for (i = 0; i < I3000_RANKS_PER_CHANNEL; i++) {
298 c0drb[i] = readb(window + I3000_C0DRB + i); 295 c0drb[i] = readb(window + I3000_C0DRB + i);
@@ -367,7 +364,8 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
367 /* Clear any error bits. 364 /* Clear any error bits.
368 * (Yes, we really clear bits by writing 1 to them.) 365 * (Yes, we really clear bits by writing 1 to them.)
369 */ 366 */
370 pci_write_bits16(pdev, I3000_ERRSTS, I3000_ERRSTS_BITS, I3000_ERRSTS_BITS); 367 pci_write_bits16(pdev, I3000_ERRSTS, I3000_ERRSTS_BITS,
368 I3000_ERRSTS_BITS);
371 369
372 rc = -ENODEV; 370 rc = -ENODEV;
373 if (edac_mc_add_mc(mci, 0)) { 371 if (edac_mc_add_mc(mci, 0)) {
@@ -388,7 +386,7 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
388 386
389/* returns count (>= 0), or negative on error */ 387/* returns count (>= 0), or negative on error */
390static int __devinit i3000_init_one(struct pci_dev *pdev, 388static int __devinit i3000_init_one(struct pci_dev *pdev,
391 const struct pci_device_id *ent) 389 const struct pci_device_id *ent)
392{ 390{
393 int rc; 391 int rc;
394 392
@@ -418,12 +416,11 @@ static void __devexit i3000_remove_one(struct pci_dev *pdev)
418 416
419static const struct pci_device_id i3000_pci_tbl[] __devinitdata = { 417static const struct pci_device_id i3000_pci_tbl[] __devinitdata = {
420 { 418 {
421 PCI_VEND_DEV(INTEL, 3000_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 419 PCI_VEND_DEV(INTEL, 3000_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
422 I3000 420 I3000},
423 },
424 { 421 {
425 0, 422 0,
426 } /* 0 terminated list. */ 423 } /* 0 terminated list. */
427}; 424};
428 425
429MODULE_DEVICE_TABLE(pci, i3000_pci_tbl); 426MODULE_DEVICE_TABLE(pci, i3000_pci_tbl);
@@ -464,10 +461,10 @@ static int __init i3000_init(void)
464 461
465 return 0; 462 return 0;
466 463
467fail1: 464 fail1:
468 pci_unregister_driver(&i3000_driver); 465 pci_unregister_driver(&i3000_driver);
469 466
470fail0: 467 fail0:
471 if (mci_pdev) 468 if (mci_pdev)
472 pci_dev_put(mci_pdev); 469 pci_dev_put(mci_pdev);
473 470