diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2010-08-20 03:32:45 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-24 09:20:40 -0400 |
commit | aace42831aa46f210bf3b0d8f1527092cc37eaad (patch) | |
tree | bf1e0c22e12f3789763c0a11fcdc8f3419504058 /drivers | |
parent | 1c6edbbe2529684859ff8e34a19e34fe9894a3b7 (diff) |
i7core_edac: Reduce args of i7core_register_mci
We can check the number of channels in i7core_register_mci.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/edac/i7core_edac.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 7164707ed99e..795df30000a1 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1947,17 +1947,20 @@ static void i7core_unregister_mci(struct i7core_dev *i7core_dev) | |||
1947 | i7core_dev->mci = NULL; | 1947 | i7core_dev->mci = NULL; |
1948 | } | 1948 | } |
1949 | 1949 | ||
1950 | static int i7core_register_mci(struct i7core_dev *i7core_dev, | 1950 | static int i7core_register_mci(struct i7core_dev *i7core_dev) |
1951 | const int num_channels, const int num_csrows) | ||
1952 | { | 1951 | { |
1953 | struct mem_ctl_info *mci; | 1952 | struct mem_ctl_info *mci; |
1954 | struct i7core_pvt *pvt; | 1953 | struct i7core_pvt *pvt; |
1955 | int csrow = 0; | 1954 | int csrow = 0; |
1956 | int rc; | 1955 | int rc, channels, csrows; |
1956 | |||
1957 | /* Check the number of active and not disabled channels */ | ||
1958 | rc = i7core_get_active_channels(i7core_dev->socket, &channels, &csrows); | ||
1959 | if (unlikely(rc < 0)) | ||
1960 | return rc; | ||
1957 | 1961 | ||
1958 | /* allocate a new MC control structure */ | 1962 | /* allocate a new MC control structure */ |
1959 | mci = edac_mc_alloc(sizeof(*pvt), num_csrows, num_channels, | 1963 | mci = edac_mc_alloc(sizeof(*pvt), csrows, channels, i7core_dev->socket); |
1960 | i7core_dev->socket); | ||
1961 | if (unlikely(!mci)) | 1964 | if (unlikely(!mci)) |
1962 | return -ENOMEM; | 1965 | return -ENOMEM; |
1963 | 1966 | ||
@@ -2079,16 +2082,7 @@ static int __devinit i7core_probe(struct pci_dev *pdev, | |||
2079 | goto fail0; | 2082 | goto fail0; |
2080 | 2083 | ||
2081 | list_for_each_entry(i7core_dev, &i7core_edac_list, list) { | 2084 | list_for_each_entry(i7core_dev, &i7core_edac_list, list) { |
2082 | int channels; | 2085 | rc = i7core_register_mci(i7core_dev); |
2083 | int csrows; | ||
2084 | |||
2085 | /* Check the number of active and not disabled channels */ | ||
2086 | rc = i7core_get_active_channels(i7core_dev->socket, | ||
2087 | &channels, &csrows); | ||
2088 | if (unlikely(rc < 0)) | ||
2089 | goto fail1; | ||
2090 | |||
2091 | rc = i7core_register_mci(i7core_dev, channels, csrows); | ||
2092 | if (unlikely(rc < 0)) | 2086 | if (unlikely(rc < 0)) |
2093 | goto fail1; | 2087 | goto fail1; |
2094 | } | 2088 | } |