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

Commit 823bccfc authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

remove "struct subsystem" as it is no longer needed



We need to work on cleaning up the relationship between kobjects, ksets and
ktypes.  The removal of 'struct subsystem' is the first step of this,
especially as it is not really needed at all.

Thanks to Kay for fixing the bugs in this patch.

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2609e7b9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -72,12 +72,12 @@ static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];

static unsigned short enable_dyn_sleep = 1;

static ssize_t omap_pm_sleep_while_idle_show(struct subsystem * subsys, char *buf)
static ssize_t omap_pm_sleep_while_idle_show(struct kset *kset, char *buf)
{
	return sprintf(buf, "%hu\n", enable_dyn_sleep);
}

static ssize_t omap_pm_sleep_while_idle_store(struct subsystem * subsys,
static ssize_t omap_pm_sleep_while_idle_store(struct kset *kset,
					      const char * buf,
					      size_t n)
{
@@ -100,7 +100,7 @@ static struct subsys_attribute sleep_while_idle_attr = {
	.store  = omap_pm_sleep_while_idle_store,
};

extern struct subsystem power_subsys;
extern struct kset power_subsys;
static void (*omap_sram_idle)(void) = NULL;
static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL;

+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
#include <asm/iseries/hv_call_xm.h>
#include <asm/iseries/iommu.h>

extern struct subsystem devices_subsys; /* needed for vio_find_name() */
extern struct kset devices_subsys; /* needed for vio_find_name() */

static struct vio_dev vio_bus_device  = { /* fake "parent" device */
	.name = vio_bus_device.dev.bus_id,
@@ -427,7 +427,7 @@ static struct vio_dev *vio_find_name(const char *kobj_name)
{
	struct kobject *found;

	found = kset_find_obj(&devices_subsys.kset, kobj_name);
	found = kset_find_obj(&devices_subsys, kobj_name);
	if (!found)
		return NULL;

+4 −4
Original line number Diff line number Diff line
@@ -28,13 +28,13 @@

unsigned long rtas_poweron_auto; /* default and normal state is 0 */

static ssize_t auto_poweron_show(struct subsystem *subsys, char *buf)
static ssize_t auto_poweron_show(struct kset *kset, char *buf)
{
        return sprintf(buf, "%lu\n", rtas_poweron_auto);
}

static ssize_t
auto_poweron_store(struct subsystem *subsys, const char *buf, size_t n)
auto_poweron_store(struct kset *kset, const char *buf, size_t n)
{
	int ret;
	unsigned long ups_restart;
@@ -72,12 +72,12 @@ static int __init pm_init(void)
{
        int error = subsystem_register(&power_subsys);
        if (!error)
                error = sysfs_create_group(&power_subsys.kset.kobj,&attr_group);
                error = sysfs_create_group(&power_subsys.kobj, &attr_group);
        return error;
}
core_initcall(pm_init);
#else
extern struct subsystem power_subsys;
extern struct kset power_subsys;

static int __init apo_pm_init(void)
{
+16 −16
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ EXPORT_SYMBOL_GPL(diag308);
/* SYSFS */

#define DEFINE_IPL_ATTR_RO(_prefix, _name, _format, _value)		\
static ssize_t sys_##_prefix##_##_name##_show(struct subsystem *subsys,	\
static ssize_t sys_##_prefix##_##_name##_show(struct kset *kset,	\
		char *page)						\
{									\
	return sprintf(page, _format, _value);				\
@@ -173,13 +173,13 @@ static struct subsys_attribute sys_##_prefix##_##_name##_attr = \
	__ATTR(_name, S_IRUGO, sys_##_prefix##_##_name##_show, NULL);

#define DEFINE_IPL_ATTR_RW(_prefix, _name, _fmt_out, _fmt_in, _value)	\
static ssize_t sys_##_prefix##_##_name##_show(struct subsystem *subsys,	\
static ssize_t sys_##_prefix##_##_name##_show(struct kset *kset,	\
		char *page)						\
{									\
	return sprintf(page, _fmt_out,					\
			(unsigned long long) _value);			\
}									\
static ssize_t sys_##_prefix##_##_name##_store(struct subsystem *subsys,\
static ssize_t sys_##_prefix##_##_name##_store(struct kset *kset,	\
		const char *buf, size_t len)				\
{									\
	unsigned long long value;					\
@@ -194,12 +194,12 @@ static struct subsys_attribute sys_##_prefix##_##_name##_attr = \
			sys_##_prefix##_##_name##_store);

#define DEFINE_IPL_ATTR_STR_RW(_prefix, _name, _fmt_out, _fmt_in, _value)\
static ssize_t sys_##_prefix##_##_name##_show(struct subsystem *subsys,	\
static ssize_t sys_##_prefix##_##_name##_show(struct kset *kset,	\
		char *page)						\
{									\
	return sprintf(page, _fmt_out, _value);				\
}									\
static ssize_t sys_##_prefix##_##_name##_store(struct subsystem *subsys,\
static ssize_t sys_##_prefix##_##_name##_store(struct kset *kset,	\
		const char *buf, size_t len)				\
{									\
	if (sscanf(buf, _fmt_in, _value) != 1)				\
@@ -272,14 +272,14 @@ void __init setup_ipl_info(void)
struct ipl_info ipl_info;
EXPORT_SYMBOL_GPL(ipl_info);

static ssize_t ipl_type_show(struct subsystem *subsys, char *page)
static ssize_t ipl_type_show(struct kset *kset, char *page)
{
	return sprintf(page, "%s\n", ipl_type_str(ipl_info.type));
}

static struct subsys_attribute sys_ipl_type_attr = __ATTR_RO(ipl_type);

static ssize_t sys_ipl_device_show(struct subsystem *subsys, char *page)
static ssize_t sys_ipl_device_show(struct kset *kset, char *page)
{
	struct ipl_parameter_block *ipl = IPL_PARMBLOCK_START;

@@ -371,7 +371,7 @@ static struct attribute_group ipl_fcp_attr_group = {

/* CCW ipl device attributes */

static ssize_t ipl_ccw_loadparm_show(struct subsystem *subsys, char *page)
static ssize_t ipl_ccw_loadparm_show(struct kset *kset, char *page)
{
	char loadparm[LOADPARM_LEN + 1] = {};

@@ -469,7 +469,7 @@ static void reipl_get_ascii_loadparm(char *loadparm)
	strstrip(loadparm);
}

static ssize_t reipl_ccw_loadparm_show(struct subsystem *subsys, char *page)
static ssize_t reipl_ccw_loadparm_show(struct kset *kset, char *page)
{
	char buf[LOADPARM_LEN + 1];

@@ -477,7 +477,7 @@ static ssize_t reipl_ccw_loadparm_show(struct subsystem *subsys, char *page)
	return sprintf(page, "%s\n", buf);
}

static ssize_t reipl_ccw_loadparm_store(struct subsystem *subsys,
static ssize_t reipl_ccw_loadparm_store(struct kset *kset,
					const char *buf, size_t len)
{
	int i, lp_len;
@@ -572,12 +572,12 @@ static int reipl_set_type(enum ipl_type type)
	return 0;
}

static ssize_t reipl_type_show(struct subsystem *subsys, char *page)
static ssize_t reipl_type_show(struct kset *kset, char *page)
{
	return sprintf(page, "%s\n", ipl_type_str(reipl_type));
}

static ssize_t reipl_type_store(struct subsystem *subsys, const char *buf,
static ssize_t reipl_type_store(struct kset *kset, const char *buf,
				size_t len)
{
	int rc = -EINVAL;
@@ -665,12 +665,12 @@ static int dump_set_type(enum dump_type type)
	return 0;
}

static ssize_t dump_type_show(struct subsystem *subsys, char *page)
static ssize_t dump_type_show(struct kset *kset, char *page)
{
	return sprintf(page, "%s\n", dump_type_str(dump_type));
}

static ssize_t dump_type_store(struct subsystem *subsys, const char *buf,
static ssize_t dump_type_store(struct kset *kset, const char *buf,
			       size_t len)
{
	int rc = -EINVAL;
@@ -697,12 +697,12 @@ static decl_subsys(shutdown_actions, NULL, NULL);

/* on panic */

static ssize_t on_panic_show(struct subsystem *subsys, char *page)
static ssize_t on_panic_show(struct kset *kset, char *page)
{
	return sprintf(page, "%s\n", shutdown_action_str(on_panic_action));
}

static ssize_t on_panic_store(struct subsystem *subsys, const char *buf,
static ssize_t on_panic_store(struct kset *kset, const char *buf,
			      size_t len)
{
	if (strncmp(buf, SHUTDOWN_REIPL_STR, strlen(SHUTDOWN_REIPL_STR)) == 0)
+6 −6
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#include <linux/buffer_head.h>
#include <linux/mutex.h>

struct subsystem block_subsys;
struct kset block_subsys;
static DEFINE_MUTEX(block_subsys_lock);

/*
@@ -221,7 +221,7 @@ static void *part_start(struct seq_file *part, loff_t *pos)
	loff_t l = *pos;

	mutex_lock(&block_subsys_lock);
	list_for_each(p, &block_subsys.kset.list)
	list_for_each(p, &block_subsys.list)
		if (!l--)
			return list_entry(p, struct gendisk, kobj.entry);
	return NULL;
@@ -231,7 +231,7 @@ static void *part_next(struct seq_file *part, void *v, loff_t *pos)
{
	struct list_head *p = ((struct gendisk *)v)->kobj.entry.next;
	++*pos;
	return p==&block_subsys.kset.list ? NULL : 
	return p==&block_subsys.list ? NULL :
		list_entry(p, struct gendisk, kobj.entry);
}

@@ -246,7 +246,7 @@ static int show_partition(struct seq_file *part, void *v)
	int n;
	char buf[BDEVNAME_SIZE];

	if (&sgp->kobj.entry == block_subsys.kset.list.next)
	if (&sgp->kobj.entry == block_subsys.list.next)
		seq_puts(part, "major minor  #blocks  name\n\n");

	/* Don't show non-partitionable removeable devices or empty devices */
@@ -565,7 +565,7 @@ static void *diskstats_start(struct seq_file *part, loff_t *pos)
	struct list_head *p;

	mutex_lock(&block_subsys_lock);
	list_for_each(p, &block_subsys.kset.list)
	list_for_each(p, &block_subsys.list)
		if (!k--)
			return list_entry(p, struct gendisk, kobj.entry);
	return NULL;
@@ -575,7 +575,7 @@ static void *diskstats_next(struct seq_file *part, void *v, loff_t *pos)
{
	struct list_head *p = ((struct gendisk *)v)->kobj.entry.next;
	++*pos;
	return p==&block_subsys.kset.list ? NULL :
	return p==&block_subsys.list ? NULL :
		list_entry(p, struct gendisk, kobj.entry);
}

Loading