Re: [PATCH updated] drivers/base: Use attribute groups to createsysfs memory files

From: Cody P Schafer
Date: Wed May 29 2013 - 17:28:09 EST


On 05/28/2013 10:17 PM, Nathan Fontenot wrote:
Update the sysfs memory code to create/delete files at the time of device
and subsystem registration.

The current code creates files in the root memory directory explicitly
through
the use of init_* routines. The files for each memory block are created and
deleted explicitly using the mem_[create|delete]_simple_file macros.

This patch creates attribute groups for the memory root files and files in
each memory block directory so that they are created and deleted implicitly
at subsys and device register and unregister time.

This did necessitate moving the register_memory() routine and update
it to set the dev.groups field.

Signed-off-by: Nathan Fontenot <nfont@xxxxxxxxxxxxxxxxxx>

Updated to apply cleanly to rc2.

Please cc me on responses/comments.
---
drivers/base/memory.c | 143
+++++++++++++++++++++-----------------------------
1 file changed, 62 insertions(+), 81 deletions(-)

Index: linux/drivers/base/memory.c
===================================================================
--- linux.orig/drivers/base/memory.c 2013-05-28 22:53:58.000000000 -0500
+++ linux/drivers/base/memory.c 2013-05-28 22:56:49.000000000 -0500

These changes look good, but this email doesn't play nice with `git am`. ex:

"fatal: corrupt patch at line 80"

There is nothing particularly bad about line 80. Please fix and resend (git format-patch generally gets this right, maybe use that?)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/