aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2015-11-30 08:20:41 -0500
committerBorislav Petkov <bp@suse.de>2015-12-11 10:56:41 -0500
commitd4538000ca4354a2c07cdd31ce994af7d23e24d6 (patch)
tree90ba7e97ebb4141e91368fe6a08e6d8408cdffc8
parenta97d26270169dc30ef28f0860097b7dc793206be (diff)
EDAC: Remove edac_get_sysfs_subsys() error handling
It cannot fail now. We either load EDAC core after having successfully initialized edac_subsys or we don't. Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r--drivers/edac/edac_device_sysfs.c5
-rw-r--r--drivers/edac/edac_mc_sysfs.c11
-rw-r--r--drivers/edac/edac_pci_sysfs.c10
3 files changed, 2 insertions, 24 deletions
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
index 170527165374..93da1a45c716 100644
--- a/drivers/edac/edac_device_sysfs.c
+++ b/drivers/edac/edac_device_sysfs.c
@@ -237,11 +237,6 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
237 237
238 /* get the /sys/devices/system/edac reference */ 238 /* get the /sys/devices/system/edac reference */
239 edac_subsys = edac_get_sysfs_subsys(); 239 edac_subsys = edac_get_sysfs_subsys();
240 if (edac_subsys == NULL) {
241 edac_dbg(1, "no edac_subsys error\n");
242 err = -ENODEV;
243 goto err_out;
244 }
245 240
246 /* Point to the 'edac_subsys' this instance 'reports' to */ 241 /* Point to the 'edac_subsys' this instance 'reports' to */
247 edac_dev->edac_subsys = edac_subsys; 242 edac_dev->edac_subsys = edac_subsys;
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 1c79ae3e083a..26e65ab5932a 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -1025,24 +1025,15 @@ static struct device_type mc_attr_type = {
1025 */ 1025 */
1026int __init edac_mc_sysfs_init(void) 1026int __init edac_mc_sysfs_init(void)
1027{ 1027{
1028 struct bus_type *edac_subsys;
1029 int err; 1028 int err;
1030 1029
1031 /* get the /sys/devices/system/edac subsys reference */
1032 edac_subsys = edac_get_sysfs_subsys();
1033 if (edac_subsys == NULL) {
1034 edac_dbg(1, "no edac_subsys\n");
1035 err = -EINVAL;
1036 goto out;
1037 }
1038
1039 mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL); 1030 mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL);
1040 if (!mci_pdev) { 1031 if (!mci_pdev) {
1041 err = -ENOMEM; 1032 err = -ENOMEM;
1042 goto out; 1033 goto out;
1043 } 1034 }
1044 1035
1045 mci_pdev->bus = edac_subsys; 1036 mci_pdev->bus = edac_get_sysfs_subsys();
1046 mci_pdev->type = &mc_attr_type; 1037 mci_pdev->type = &mc_attr_type;
1047 device_initialize(mci_pdev); 1038 device_initialize(mci_pdev);
1048 dev_set_name(mci_pdev, "mc"); 1039 dev_set_name(mci_pdev, "mc");
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index 262f56cca9ff..6e3428ba400f 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -331,10 +331,7 @@ static struct kobj_type ktype_edac_pci_main_kobj = {
331}; 331};
332 332
333/** 333/**
334 * edac_pci_main_kobj_setup() 334 * edac_pci_main_kobj_setup: Setup the sysfs for EDAC PCI attributes.
335 *
336 * setup the sysfs for EDAC PCI attributes
337 * assumes edac_subsys has already been initialized
338 */ 335 */
339static int edac_pci_main_kobj_setup(void) 336static int edac_pci_main_kobj_setup(void)
340{ 337{
@@ -351,11 +348,6 @@ static int edac_pci_main_kobj_setup(void)
351 * controls and attributes 348 * controls and attributes
352 */ 349 */
353 edac_subsys = edac_get_sysfs_subsys(); 350 edac_subsys = edac_get_sysfs_subsys();
354 if (edac_subsys == NULL) {
355 edac_dbg(1, "no edac_subsys\n");
356 err = -ENODEV;
357 goto decrement_count_fail;
358 }
359 351
360 /* Bump the reference count on this module to ensure the 352 /* Bump the reference count on this module to ensure the
361 * modules isn't unloaded until we deconstruct the top 353 * modules isn't unloaded until we deconstruct the top