]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
driver core: remove CLASS_ATTR usage
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Jun 2017 13:32:03 +0000 (15:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Jun 2017 09:15:22 +0000 (11:15 +0200)
There was only 2 remaining users of CLASS_ATTR() so let's finally get
rid of them and force everyone to use the correct RW/RO/WO versions
instead.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/pseries/dlpar.c
arch/powerpc/platforms/pseries/mobility.c
include/linux/device.h

index bda18d8e1674b5c269b2de692c2afb1c9d05ed5d..39187696ee74b2bc6b3d10a6a0638474b6de326e 100644 (file)
@@ -588,7 +588,7 @@ static ssize_t dlpar_show(struct class *class, struct class_attribute *attr,
        return sprintf(buf, "%s\n", "memory,cpu");
 }
 
-static CLASS_ATTR(dlpar, S_IWUSR | S_IRUSR, dlpar_show, dlpar_store);
+static CLASS_ATTR_RW(dlpar);
 
 static int __init pseries_dlpar_init(void)
 {
index 5a0c7ba429ceb7ac34c2682679a68151ac37f65b..2da4851eff994717ef218d68831a78138604136a 100644 (file)
@@ -349,8 +349,9 @@ void post_mobility_fixup(void)
        return;
 }
 
-static ssize_t migrate_store(struct class *class, struct class_attribute *attr,
-                            const char *buf, size_t count)
+static ssize_t migration_store(struct class *class,
+                              struct class_attribute *attr, const char *buf,
+                              size_t count)
 {
        u64 streamid;
        int rc;
@@ -380,7 +381,7 @@ static ssize_t migrate_store(struct class *class, struct class_attribute *attr,
  */
 #define MIGRATION_API_VERSION  1
 
-static CLASS_ATTR(migration, S_IWUSR, NULL, migrate_store);
+static CLASS_ATTR_WO(migration);
 static CLASS_ATTR_STRING(api_version, S_IRUGO, __stringify(MIGRATION_API_VERSION));
 
 static int __init mobility_sysfs_init(void)
index 9ef518af5515a01e202dee3cf4c27ffcd8c56441..9a902ae339326696cd5f4a725585f7269bc3700f 100644 (file)
@@ -465,8 +465,6 @@ struct class_attribute {
                        const char *buf, size_t count);
 };
 
-#define CLASS_ATTR(_name, _mode, _show, _store) \
-       struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store)
 #define CLASS_ATTR_RW(_name) \
        struct class_attribute class_attr_##_name = __ATTR_RW(_name)
 #define CLASS_ATTR_RO(_name) \