diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2010-08-20 03:28:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-24 09:20:39 -0400 |
commit | 5939813b9c4270d0f46375c3cad64226bb1fcd62 (patch) | |
tree | 957f303c358b207d4e6d6780ff4b26b95e5c92e5 /drivers/edac | |
parent | 64c10f6e0e6b4473b97c29c574e9517f93bedaec (diff) |
i7core_edac: Fix order of lines in i7core_register_mci
The flag is_registered is not initialized until mci_bind_devs()
is called. Refer it properly.
The mci->dev and mci->edac_check is required in edac_mc_add_mc(),
so prepare them just before the call.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i7core_edac.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 19faeffac9dc..6bebf4d73f48 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1933,9 +1933,6 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev, | |||
1933 | debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p\n", | 1933 | debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p\n", |
1934 | __func__, mci, &i7core_dev->pdev[0]->dev); | 1934 | __func__, mci, &i7core_dev->pdev[0]->dev); |
1935 | 1935 | ||
1936 | /* record ptr to the generic device */ | ||
1937 | mci->dev = &i7core_dev->pdev[0]->dev; | ||
1938 | |||
1939 | pvt = mci->pvt_info; | 1936 | pvt = mci->pvt_info; |
1940 | memset(pvt, 0, sizeof(*pvt)); | 1937 | memset(pvt, 0, sizeof(*pvt)); |
1941 | 1938 | ||
@@ -1954,21 +1951,22 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev, | |||
1954 | mci->dev_name = pci_name(i7core_dev->pdev[0]); | 1951 | mci->dev_name = pci_name(i7core_dev->pdev[0]); |
1955 | mci->ctl_page_to_phys = NULL; | 1952 | mci->ctl_page_to_phys = NULL; |
1956 | 1953 | ||
1957 | if (pvt->is_registered) | ||
1958 | mci->mc_driver_sysfs_attributes = i7core_sysfs_rdimm_attrs; | ||
1959 | else | ||
1960 | mci->mc_driver_sysfs_attributes = i7core_sysfs_udimm_attrs; | ||
1961 | |||
1962 | /* Set the function pointer to an actual operation function */ | ||
1963 | mci->edac_check = i7core_check_error; | ||
1964 | |||
1965 | /* Store pci devices at mci for faster access */ | 1954 | /* Store pci devices at mci for faster access */ |
1966 | rc = mci_bind_devs(mci, i7core_dev); | 1955 | rc = mci_bind_devs(mci, i7core_dev); |
1967 | if (unlikely(rc < 0)) | 1956 | if (unlikely(rc < 0)) |
1968 | goto fail; | 1957 | goto fail; |
1969 | 1958 | ||
1959 | if (pvt->is_registered) | ||
1960 | mci->mc_driver_sysfs_attributes = i7core_sysfs_rdimm_attrs; | ||
1961 | else | ||
1962 | mci->mc_driver_sysfs_attributes = i7core_sysfs_udimm_attrs; | ||
1963 | |||
1970 | /* Get dimm basic config */ | 1964 | /* Get dimm basic config */ |
1971 | get_dimm_config(mci, &csrow); | 1965 | get_dimm_config(mci, &csrow); |
1966 | /* record ptr to the generic device */ | ||
1967 | mci->dev = &i7core_dev->pdev[0]->dev; | ||
1968 | /* Set the function pointer to an actual operation function */ | ||
1969 | mci->edac_check = i7core_check_error; | ||
1972 | 1970 | ||
1973 | /* add this new MC control structure to EDAC's list of MCs */ | 1971 | /* add this new MC control structure to EDAC's list of MCs */ |
1974 | if (unlikely(edac_mc_add_mc(mci))) { | 1972 | if (unlikely(edac_mc_add_mc(mci))) { |