aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/memory.c
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2010-01-05 06:48:07 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-07 20:04:48 -0500
commit28812fe11a21826ba4c97c6c7971a619987cd912 (patch)
treec78daefd595989bbc660ea48d8bc2dc5750321d3 /drivers/base/memory.c
parent5fbcae57db69128c14080a7a5a42d0626bfe155c (diff)
driver-core: Add attribute argument to class_attribute show/store
Passing the attribute to the low level IO functions allows all kinds of cleanups, by sharing low level IO code without requiring an own function for every piece of data. Also drivers can extend the attributes with own data fields and use that in the low level function. This makes the class attributes the same as sysdev_class attributes and plain attributes. This will allow further cleanups in drivers. Full tree sweep converting all users. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r--drivers/base/memory.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 563656ad75a1..495f15e92d4c 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -331,7 +331,8 @@ static int block_size_init(void)
331 */ 331 */
332#ifdef CONFIG_ARCH_MEMORY_PROBE 332#ifdef CONFIG_ARCH_MEMORY_PROBE
333static ssize_t 333static ssize_t
334memory_probe_store(struct class *class, const char *buf, size_t count) 334memory_probe_store(struct class *class, struct class_attribute *attr,
335 const char *buf, size_t count)
335{ 336{
336 u64 phys_addr; 337 u64 phys_addr;
337 int nid; 338 int nid;
@@ -368,7 +369,9 @@ static inline int memory_probe_init(void)
368 369
369/* Soft offline a page */ 370/* Soft offline a page */
370static ssize_t 371static ssize_t
371store_soft_offline_page(struct class *class, const char *buf, size_t count) 372store_soft_offline_page(struct class *class,
373 struct class_attribute *attr,
374 const char *buf, size_t count)
372{ 375{
373 int ret; 376 int ret;
374 u64 pfn; 377 u64 pfn;
@@ -385,7 +388,9 @@ store_soft_offline_page(struct class *class, const char *buf, size_t count)
385 388
386/* Forcibly offline a page, including killing processes. */ 389/* Forcibly offline a page, including killing processes. */
387static ssize_t 390static ssize_t
388store_hard_offline_page(struct class *class, const char *buf, size_t count) 391store_hard_offline_page(struct class *class,
392 struct class_attribute *attr,
393 const char *buf, size_t count)
389{ 394{
390 int ret; 395 int ret;
391 u64 pfn; 396 u64 pfn;