Commit 49d948a1 authored by Viktor Rosendahl's avatar Viktor Rosendahl Committed by Tony Lindgren

lowmem: sysfs has changed

Currently, the lowmem module doesn't even compile because the kernel API has
changed. This patch will unbreak the sysfs related code.
Signed-off-by: default avatarViktor Rosendahl <viktor.rosendahl@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent d0160ff8
...@@ -117,16 +117,18 @@ static ctl_table lowmem_root_table[] = { ...@@ -117,16 +117,18 @@ static ctl_table lowmem_root_table[] = {
}; };
#define KERNEL_ATTR_RO(_name) \ #define KERNEL_ATTR_RO(_name) \
static struct subsys_attribute _name##_attr = __ATTR_RO(_name) static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
static int low_watermark_reached, high_watermark_reached; static int low_watermark_reached, high_watermark_reached;
static ssize_t low_watermark_show(struct subsystem *subsys, char *page) static ssize_t low_watermark_show(struct kobject *kobj,
struct kobj_attribute *attr, char *page)
{ {
return sprintf(page, "%u\n", low_watermark_reached); return sprintf(page, "%u\n", low_watermark_reached);
} }
static ssize_t high_watermark_show(struct subsystem *subsys, char *page) static ssize_t high_watermark_show(struct kobject *kobj,
struct kobj_attribute *attr, char *page)
{ {
return sprintf(page, "%u\n", high_watermark_reached); return sprintf(page, "%u\n", high_watermark_reached);
} }
...@@ -138,7 +140,7 @@ static void low_watermark_state(int new_state) ...@@ -138,7 +140,7 @@ static void low_watermark_state(int new_state)
{ {
if (low_watermark_reached != new_state) { if (low_watermark_reached != new_state) {
low_watermark_reached = new_state; low_watermark_reached = new_state;
sysfs_notify(&kernel_subsys.kset.kobj, NULL, "low_watermark"); sysfs_notify(kernel_kobj, NULL, "low_watermark");
} }
} }
...@@ -146,7 +148,7 @@ static void high_watermark_state(int new_state) ...@@ -146,7 +148,7 @@ static void high_watermark_state(int new_state)
{ {
if (high_watermark_reached != new_state) { if (high_watermark_reached != new_state) {
high_watermark_reached = new_state; high_watermark_reached = new_state;
sysfs_notify(&kernel_subsys.kset.kobj, NULL, "high_watermark"); sysfs_notify(kernel_kobj, NULL, "high_watermark");
} }
} }
...@@ -279,9 +281,7 @@ static int __init lowmem_init(void) ...@@ -279,9 +281,7 @@ static int __init lowmem_init(void)
if (unlikely(!lowmem_table_header)) if (unlikely(!lowmem_table_header))
return -EPERM; return -EPERM;
kernel_subsys.kset.kobj.kset = &kernel_subsys.kset; r = sysfs_create_group(kernel_kobj,
r = sysfs_create_group(&kernel_subsys.kset.kobj,
&lowmem_attr_group); &lowmem_attr_group);
if (unlikely(r)) if (unlikely(r))
return r; return r;
...@@ -307,7 +307,7 @@ static void __exit lowmem_exit(void) ...@@ -307,7 +307,7 @@ static void __exit lowmem_exit(void)
unregister_sysctl_table(lowmem_table_header); unregister_sysctl_table(lowmem_table_header);
sysfs_remove_group(&kernel_subsys.kset.kobj, &lowmem_attr_group); sysfs_remove_group(kernel_kobj, &lowmem_attr_group);
printk(KERN_INFO MY_NAME ": Module removed.\n"); printk(KERN_INFO MY_NAME ": Module removed.\n");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment