Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe5ff8b8 authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman
Browse files

edac: convert sysdev_class to a regular subsystem



After all sysdev classes are ported to regular driver core entities, the
sysdev implementation will be entirely removed from the kernel.

Cc: Doug Thompson <dougthompson@xmission.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 997d3eaf
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@
#include <linux/completion.h>
#include <linux/kobject.h>
#include <linux/platform_device.h>
#include <linux/sysdev.h>
#include <linux/workqueue.h>
#include <linux/edac.h>

@@ -243,8 +242,8 @@ struct edac_device_ctl_info {
	 */
	struct edac_dev_sysfs_attribute *sysfs_attributes;

	/* pointer to main 'edac' class in sysfs */
	struct sysdev_class *edac_class;
	/* pointer to main 'edac' subsys in sysfs */
	struct bus_type *edac_subsys;

	/* the internal state of this controller instance */
	int op_state;
@@ -342,7 +341,7 @@ struct edac_pci_ctl_info {

	int pci_idx;

	struct sysdev_class *edac_class;	/* pointer to class */
	struct bus_type *edac_subsys;	/* pointer to subsystem */

	/* the internal state of this controller instance */
	int op_state;
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@
#include <linux/jiffies.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/sysdev.h>
#include <linux/ctype.h>
#include <linux/workqueue.h>
#include <asm/uaccess.h>
+10 −10
Original line number Diff line number Diff line
/*
 * file for managing the edac_device class of devices for EDAC
 * file for managing the edac_device subsystem of devices for EDAC
 *
 * (C) 2007 SoftwareBitMaker 
 *
@@ -230,21 +230,21 @@ static struct kobj_type ktype_device_ctrl = {
 */
int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
{
	struct sysdev_class *edac_class;
	struct bus_type *edac_subsys;
	int err;

	debugf1("%s()\n", __func__);

	/* get the /sys/devices/system/edac reference */
	edac_class = edac_get_sysfs_class();
	if (edac_class == NULL) {
		debugf1("%s() no edac_class error\n", __func__);
	edac_subsys = edac_get_sysfs_subsys();
	if (edac_subsys == NULL) {
		debugf1("%s() no edac_subsys error\n", __func__);
		err = -ENODEV;
		goto err_out;
	}

	/* Point to the 'edac_class' this instance 'reports' to */
	edac_dev->edac_class = edac_class;
	/* Point to the 'edac_subsys' this instance 'reports' to */
	edac_dev->edac_subsys = edac_subsys;

	/* Init the devices's kobject */
	memset(&edac_dev->kobj, 0, sizeof(struct kobject));
@@ -261,7 +261,7 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)

	/* register */
	err = kobject_init_and_add(&edac_dev->kobj, &ktype_device_ctrl,
				   &edac_class->kset.kobj,
				   &edac_subsys->dev_root->kobj,
				   "%s", edac_dev->name);
	if (err) {
		debugf1("%s()Failed to register '.../edac/%s'\n",
@@ -284,7 +284,7 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
	module_put(edac_dev->owner);

err_mod_get:
	edac_put_sysfs_class();
	edac_put_sysfs_subsys();

err_out:
	return err;
@@ -308,7 +308,7 @@ void edac_device_unregister_sysfs_main_kobj(struct edac_device_ctl_info *dev)
	 *   b) 'kfree' the memory
	 */
	kobject_put(&dev->kobj);
	edac_put_sysfs_class();
	edac_put_sysfs_subsys();
}

/* edac_dev -> instance information */
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include <linux/jiffies.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/sysdev.h>
#include <linux/ctype.h>
#include <linux/edac.h>
#include <asm/uaccess.h>
+8 −8
Original line number Diff line number Diff line
@@ -1021,19 +1021,19 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
int edac_sysfs_setup_mc_kset(void)
{
	int err = -EINVAL;
	struct sysdev_class *edac_class;
	struct bus_type *edac_subsys;

	debugf1("%s()\n", __func__);

	/* get the /sys/devices/system/edac class reference */
	edac_class = edac_get_sysfs_class();
	if (edac_class == NULL) {
		debugf1("%s() no edac_class error=%d\n", __func__, err);
	/* get the /sys/devices/system/edac subsys reference */
	edac_subsys = edac_get_sysfs_subsys();
	if (edac_subsys == NULL) {
		debugf1("%s() no edac_subsys error=%d\n", __func__, err);
		goto fail_out;
	}

	/* Init the MC's kobject */
	mc_kset = kset_create_and_add("mc", NULL, &edac_class->kset.kobj);
	mc_kset = kset_create_and_add("mc", NULL, &edac_subsys->dev_root->kobj);
	if (!mc_kset) {
		err = -ENOMEM;
		debugf1("%s() Failed to register '.../edac/mc'\n", __func__);
@@ -1045,7 +1045,7 @@ int edac_sysfs_setup_mc_kset(void)
	return 0;

fail_kset:
	edac_put_sysfs_class();
	edac_put_sysfs_subsys();

fail_out:
	return err;
@@ -1059,6 +1059,6 @@ int edac_sysfs_setup_mc_kset(void)
void edac_sysfs_teardown_mc_kset(void)
{
	kset_unregister(mc_kset);
	edac_put_sysfs_class();
	edac_put_sysfs_subsys();
}
Loading