diff options
author | Dave Jiang <djiang@mvista.com> | 2007-07-19 04:49:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:53 -0400 |
commit | c4192705fec85219086231a1c0fa61e8776e2c3b (patch) | |
tree | 2ac7f03963fbc1bec8457a0f4a61adeb398a5df7 /drivers/edac/edac_core.h | |
parent | 20bcb7a81dee21bfa3408f03f46b2891c9b5c84b (diff) |
drivers/edac: add dev_name getter function
Move dev_name() macro to a more generic interface since it's not possible
to determine whether a device is pci, platform, or of_device easily.
Now each low level driver sets the name into the control structure, and
the EDAC core references the control structure for the information.
Better abstraction.
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>
Diffstat (limited to 'drivers/edac/edac_core.h')
-rw-r--r-- | drivers/edac/edac_core.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index 968f48399e00..f34ebb609d55 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h | |||
@@ -95,11 +95,7 @@ extern int edac_debug_level; | |||
95 | #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ | 95 | #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ |
96 | PCI_DEVICE_ID_ ## vend ## _ ## dev | 96 | PCI_DEVICE_ID_ ## vend ## _ ## dev |
97 | 97 | ||
98 | #if defined(CONFIG_X86) && defined(CONFIG_PCI) | 98 | #define dev_name(dev) (dev)->dev_name |
99 | #define dev_name(dev) pci_name(to_pci_dev(dev)) | ||
100 | #else | ||
101 | #define dev_name(dev) to_platform_device(dev)->name | ||
102 | #endif | ||
103 | 99 | ||
104 | /* memory devices */ | 100 | /* memory devices */ |
105 | enum dev_type { | 101 | enum dev_type { |
@@ -368,6 +364,7 @@ struct mem_ctl_info { | |||
368 | const char *mod_name; | 364 | const char *mod_name; |
369 | const char *mod_ver; | 365 | const char *mod_ver; |
370 | const char *ctl_name; | 366 | const char *ctl_name; |
367 | const char *dev_name; | ||
371 | char proc_name[MC_PROC_NAME_MAX_LEN + 1]; | 368 | char proc_name[MC_PROC_NAME_MAX_LEN + 1]; |
372 | void *pvt_info; | 369 | void *pvt_info; |
373 | u32 ue_noinfo_count; /* Uncorrectable Errors w/o info */ | 370 | u32 ue_noinfo_count; /* Uncorrectable Errors w/o info */ |
@@ -538,6 +535,7 @@ struct edac_device_ctl_info { | |||
538 | 535 | ||
539 | const char *mod_name; /* module name */ | 536 | const char *mod_name; /* module name */ |
540 | const char *ctl_name; /* edac controller name */ | 537 | const char *ctl_name; /* edac controller name */ |
538 | const char *dev_name; /* pci/platform/etc... name */ | ||
541 | 539 | ||
542 | void *pvt_info; /* pointer to 'private driver' info */ | 540 | void *pvt_info; /* pointer to 'private driver' info */ |
543 | 541 | ||