aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mc.h
diff options
context:
space:
mode:
authorDoug Thompson <norsk5@xmission.com>2006-06-30 04:56:07 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-30 14:25:39 -0400
commit37f04581abac20444e5b7106c1e1f28bec5b989c (patch)
tree4112a057284749c5d53c6b9a8bf9f5e6c4ba34ef /drivers/edac/edac_mc.h
parentdc474c891c1993c4d608bed00c425b6db93d088d (diff)
[PATCH] EDAC: PCI device to DEVICE cleanup
Change MC drivers from using CVS revision strings for their version number, Now each driver has its own local string. Remove some PCI dependencies from the core EDAC module. Made the code 'struct device' centric instead of 'struct pci_dev' Most of the code changes here are from a patch by Dave Jiang. It may be best to eventually move the PCI-specific code into a separate source file. Signed-off-by: Doug Thompson <norsk5@xmission.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/edac/edac_mc.h')
-rw-r--r--drivers/edac/edac_mc.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/edac/edac_mc.h b/drivers/edac/edac_mc.h
index 8d9e83909b9c..a2c3a4607a89 100644
--- a/drivers/edac/edac_mc.h
+++ b/drivers/edac/edac_mc.h
@@ -88,6 +88,12 @@ extern int edac_debug_level;
88#define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ 88#define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \
89 PCI_DEVICE_ID_ ## vend ## _ ## dev 89 PCI_DEVICE_ID_ ## vend ## _ ## dev
90 90
91#if defined(CONFIG_X86) && defined(CONFIG_PCI)
92#define dev_name(dev) pci_name(to_pci_dev(dev))
93#else
94#define dev_name(dev) to_platform_device(dev)->name
95#endif
96
91/* memory devices */ 97/* memory devices */
92enum dev_type { 98enum dev_type {
93 DEV_UNKNOWN = 0, 99 DEV_UNKNOWN = 0,
@@ -327,10 +333,10 @@ struct mem_ctl_info {
327 struct csrow_info *csrows; 333 struct csrow_info *csrows;
328 /* 334 /*
329 * FIXME - what about controllers on other busses? - IDs must be 335 * FIXME - what about controllers on other busses? - IDs must be
330 * unique. pdev pointer should be sufficiently unique, but 336 * unique. dev pointer should be sufficiently unique, but
331 * BUS:SLOT.FUNC numbers may not be unique. 337 * BUS:SLOT.FUNC numbers may not be unique.
332 */ 338 */
333 struct pci_dev *pdev; 339 struct device *dev;
334 const char *mod_name; 340 const char *mod_name;
335 const char *mod_ver; 341 const char *mod_ver;
336 const char *ctl_name; 342 const char *ctl_name;
@@ -353,6 +359,8 @@ struct mem_ctl_info {
353 struct completion kobj_complete; 359 struct completion kobj_complete;
354}; 360};
355 361
362#ifdef CONFIG_PCI
363
356/* write all or some bits in a byte-register*/ 364/* write all or some bits in a byte-register*/
357static inline void pci_write_bits8(struct pci_dev *pdev, int offset, u8 value, 365static inline void pci_write_bits8(struct pci_dev *pdev, int offset, u8 value,
358 u8 mask) 366 u8 mask)
@@ -401,6 +409,8 @@ static inline void pci_write_bits32(struct pci_dev *pdev, int offset,
401 pci_write_config_dword(pdev, offset, value); 409 pci_write_config_dword(pdev, offset, value);
402} 410}
403 411
412#endif /* CONFIG_PCI */
413
404#ifdef CONFIG_EDAC_DEBUG 414#ifdef CONFIG_EDAC_DEBUG
405void edac_mc_dump_channel(struct channel_info *chan); 415void edac_mc_dump_channel(struct channel_info *chan);
406void edac_mc_dump_mci(struct mem_ctl_info *mci); 416void edac_mc_dump_mci(struct mem_ctl_info *mci);
@@ -408,7 +418,7 @@ void edac_mc_dump_csrow(struct csrow_info *csrow);
408#endif /* CONFIG_EDAC_DEBUG */ 418#endif /* CONFIG_EDAC_DEBUG */
409 419
410extern int edac_mc_add_mc(struct mem_ctl_info *mci); 420extern int edac_mc_add_mc(struct mem_ctl_info *mci);
411extern struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev); 421extern struct mem_ctl_info * edac_mc_del_mc(struct device *dev);
412extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, 422extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
413 unsigned long page); 423 unsigned long page);
414extern void edac_mc_scrub_block(unsigned long page, unsigned long offset, 424extern void edac_mc_scrub_block(unsigned long page, unsigned long offset,