linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] driver core: remove CLASS_ATTR usage
@ 2017-06-06 13:32 Greg KH
  2017-06-07  1:40 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2017-06-06 13:32 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: linuxppc-dev, linux-kernel

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

PPC maintainers, can I take this in my driver core tree?  I'm doing some
cleanups of device.h and this was one of the simpler ones at the moment.

thanks,

greg k-h

 arch/powerpc/platforms/pseries/dlpar.c    |    2 +-
 arch/powerpc/platforms/pseries/mobility.c |    7 ++++---
 include/linux/device.h                    |    2 --
 3 files changed, 5 insertions(+), 6 deletions(-)

--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -588,7 +588,7 @@ static ssize_t dlpar_show(struct class *
 	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)
 {
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -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 clas
  */
 #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)
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -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) \

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] driver core: remove CLASS_ATTR usage
  2017-06-06 13:32 [PATCH] driver core: remove CLASS_ATTR usage Greg KH
@ 2017-06-07  1:40 ` Michael Ellerman
  2017-06-07  9:14   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2017-06-07  1:40 UTC (permalink / raw)
  To: Greg KH, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, linux-kernel

Greg KH <gregkh@linuxfoundation.org> writes:

> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> 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>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>
> PPC maintainers, can I take this in my driver core tree?  I'm doing some
> cleanups of device.h and this was one of the simpler ones at the moment.

Yeah looks good to me, I did a quick build test and it was OK.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] driver core: remove CLASS_ATTR usage
  2017-06-07  1:40 ` Michael Ellerman
@ 2017-06-07  9:14   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2017-06-07  9:14 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, linux-kernel

On Wed, Jun 07, 2017 at 11:40:12AM +1000, Michael Ellerman wrote:
> Greg KH <gregkh@linuxfoundation.org> writes:
> 
> > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> > 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>
> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >
> > PPC maintainers, can I take this in my driver core tree?  I'm doing some
> > cleanups of device.h and this was one of the simpler ones at the moment.
> 
> Yeah looks good to me, I did a quick build test and it was OK.
> 
> Acked-by: Michael Ellerman <mpe@ellerman.id.au>

Wonderful, thanks for testing it out.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-07  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 13:32 [PATCH] driver core: remove CLASS_ATTR usage Greg KH
2017-06-07  1:40 ` Michael Ellerman
2017-06-07  9:14   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).