Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -24
-5
drivers/edac/edac_device_sysfs.c
··· 237 237 238 238 /* get the /sys/devices/system/edac reference */ 239 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 241 /* Point to the 'edac_subsys' this instance 'reports' to */ 247 242 edac_dev->edac_subsys = edac_subsys;
+1 -10
drivers/edac/edac_mc_sysfs.c
··· 1025 1025 */ 1026 1026 int __init edac_mc_sysfs_init(void) 1027 1027 { 1028 - struct bus_type *edac_subsys; 1029 1028 int err; 1030 - 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 1029 1039 1030 mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL); 1040 1031 if (!mci_pdev) { ··· 1033 1042 goto out; 1034 1043 } 1035 1044 1036 - mci_pdev->bus = edac_subsys; 1045 + mci_pdev->bus = edac_get_sysfs_subsys(); 1037 1046 mci_pdev->type = &mc_attr_type; 1038 1047 device_initialize(mci_pdev); 1039 1048 dev_set_name(mci_pdev, "mc");
+1 -9
drivers/edac/edac_pci_sysfs.c
··· 331 331 }; 332 332 333 333 /** 334 - * edac_pci_main_kobj_setup() 335 - * 336 - * setup the sysfs for EDAC PCI attributes 337 - * assumes edac_subsys has already been initialized 334 + * edac_pci_main_kobj_setup: Setup the sysfs for EDAC PCI attributes. 338 335 */ 339 336 static int edac_pci_main_kobj_setup(void) 340 337 { ··· 348 351 * controls and attributes 349 352 */ 350 353 edac_subsys = edac_get_sysfs_subsys(); 351 - if (edac_subsys == NULL) { 352 - edac_dbg(1, "no edac_subsys\n"); 353 - err = -ENODEV; 354 - goto decrement_count_fail; 355 - } 356 354 357 355 /* Bump the reference count on this module to ensure the 358 356 * modules isn't unloaded until we deconstruct the top