powerpc/powernv Adapt opal-elog and opal-dump to new sysfs_remove_file_self
authorStewart Smith <stewart@linux.vnet.ibm.com>
Wed, 9 Apr 2014 03:47:37 +0000 (13:47 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 9 Apr 2014 03:51:50 +0000 (13:51 +1000)
We are currently using sysfs_schedule_callback() which is deprecated
and about to be removed. Switch to the new interface instead.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powernv/opal-dump.c
arch/powerpc/platforms/powernv/opal-elog.c

index 0c767c561dc99495bffd172d61a0ca063a0c3145..b9827b0d87e4cd69cdff9f51216ea9429c79fb41 100644 (file)
@@ -86,19 +86,14 @@ static int64_t dump_send_ack(uint32_t dump_id)
        return rc;
 }
 
-static void delay_release_kobj(void *kobj)
-{
-       kobject_put((struct kobject *)kobj);
-}
-
 static ssize_t dump_ack_store(struct dump_obj *dump_obj,
                              struct dump_attribute *attr,
                              const char *buf,
                              size_t count)
 {
        dump_send_ack(dump_obj->id);
-       sysfs_schedule_callback(&dump_obj->kobj, delay_release_kobj,
-                               &dump_obj->kobj, THIS_MODULE);
+       sysfs_remove_file_self(&dump_obj->kobj, &attr->attr);
+       kobject_put(&dump_obj->kobj);
        return count;
 }
 
index 1d7355bc9db065458b9f9913ec787e6f0ffe7b89..ef7bc2a978627422d659d783ea21f0869975df53 100644 (file)
@@ -70,19 +70,14 @@ static ssize_t elog_ack_show(struct elog_obj *elog_obj,
        return sprintf(buf, "ack - acknowledge log message\n");
 }
 
-static void delay_release_kobj(void *kobj)
-{
-       kobject_put((struct kobject *)kobj);
-}
-
 static ssize_t elog_ack_store(struct elog_obj *elog_obj,
                              struct elog_attribute *attr,
                              const char *buf,
                              size_t count)
 {
        opal_send_ack_elog(elog_obj->id);
-       sysfs_schedule_callback(&elog_obj->kobj, delay_release_kobj,
-                               &elog_obj->kobj, THIS_MODULE);
+       sysfs_remove_file_self(&elog_obj->kobj, &attr->attr);
+       kobject_put(&elog_obj->kobj);
        return count;
 }