diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2010-11-24 13:52:09 -0500 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2011-01-07 05:38:31 -0500 |
commit | 390944439f746824faec51b576f50cb5ef18745b (patch) | |
tree | 5fd15e75e8e5e5d3dc1e176c655829f9d0f83aa9 /drivers/edac/cpc925_edac.c | |
parent | 360b7f3c602ed80ce8c6b2585dcb76883a440c17 (diff) |
EDAC: Fixup scrubrate manipulation
Make the ->{get|set}_sdram_scrub_rate return the actual scrub rate
bandwidth it succeeded setting and remove superfluous arg pointer used
for that. A negative value returned still means that an error occurred
while setting the scrubrate. Document this for future reference.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac/cpc925_edac.c')
-rw-r--r-- | drivers/edac/cpc925_edac.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c index 1609a19df495..b9a781c47e3c 100644 --- a/drivers/edac/cpc925_edac.c +++ b/drivers/edac/cpc925_edac.c | |||
@@ -818,9 +818,10 @@ static void cpc925_del_edac_devices(void) | |||
818 | } | 818 | } |
819 | 819 | ||
820 | /* Convert current back-ground scrub rate into byte/sec bandwith */ | 820 | /* Convert current back-ground scrub rate into byte/sec bandwith */ |
821 | static int cpc925_get_sdram_scrub_rate(struct mem_ctl_info *mci, u32 *bw) | 821 | static int cpc925_get_sdram_scrub_rate(struct mem_ctl_info *mci) |
822 | { | 822 | { |
823 | struct cpc925_mc_pdata *pdata = mci->pvt_info; | 823 | struct cpc925_mc_pdata *pdata = mci->pvt_info; |
824 | int bw; | ||
824 | u32 mscr; | 825 | u32 mscr; |
825 | u8 si; | 826 | u8 si; |
826 | 827 | ||
@@ -832,11 +833,11 @@ static int cpc925_get_sdram_scrub_rate(struct mem_ctl_info *mci, u32 *bw) | |||
832 | if (((mscr & MSCR_SCRUB_MOD_MASK) != MSCR_BACKGR_SCRUB) || | 833 | if (((mscr & MSCR_SCRUB_MOD_MASK) != MSCR_BACKGR_SCRUB) || |
833 | (si == 0)) { | 834 | (si == 0)) { |
834 | cpc925_mc_printk(mci, KERN_INFO, "Scrub mode not enabled\n"); | 835 | cpc925_mc_printk(mci, KERN_INFO, "Scrub mode not enabled\n"); |
835 | *bw = 0; | 836 | bw = 0; |
836 | } else | 837 | } else |
837 | *bw = CPC925_SCRUB_BLOCK_SIZE * 0xFA67 / si; | 838 | bw = CPC925_SCRUB_BLOCK_SIZE * 0xFA67 / si; |
838 | 839 | ||
839 | return 0; | 840 | return bw; |
840 | } | 841 | } |
841 | 842 | ||
842 | /* Return 0 for single channel; 1 for dual channel */ | 843 | /* Return 0 for single channel; 1 for dual channel */ |