diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/memory.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index ae6b6c43cff9..bd025059711f 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -309,19 +309,17 @@ static SYSDEV_ATTR(removable, 0444, show_mem_removable, NULL); | |||
309 | * Block size attribute stuff | 309 | * Block size attribute stuff |
310 | */ | 310 | */ |
311 | static ssize_t | 311 | static ssize_t |
312 | print_block_size(struct sysdev_class *class, | 312 | print_block_size(struct class *class, char *buf) |
313 | struct sysdev_class_attribute *class_attr, | ||
314 | char *buf) | ||
315 | { | 313 | { |
316 | return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE); | 314 | return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE); |
317 | } | 315 | } |
318 | 316 | ||
319 | static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); | 317 | static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); |
320 | 318 | ||
321 | static int block_size_init(void) | 319 | static int block_size_init(void) |
322 | { | 320 | { |
323 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 321 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, |
324 | &attr_block_size_bytes.attr); | 322 | &class_attr_block_size_bytes.attr); |
325 | } | 323 | } |
326 | 324 | ||
327 | /* | 325 | /* |
@@ -332,9 +330,7 @@ static int block_size_init(void) | |||
332 | */ | 330 | */ |
333 | #ifdef CONFIG_ARCH_MEMORY_PROBE | 331 | #ifdef CONFIG_ARCH_MEMORY_PROBE |
334 | static ssize_t | 332 | static ssize_t |
335 | memory_probe_store(struct sysdev_class *class, | 333 | memory_probe_store(struct class *class, const char *buf, size_t count) |
336 | struct sysdev_class_attribute *class_attr, | ||
337 | const char *buf, size_t count) | ||
338 | { | 334 | { |
339 | u64 phys_addr; | 335 | u64 phys_addr; |
340 | int nid; | 336 | int nid; |
@@ -350,12 +346,12 @@ memory_probe_store(struct sysdev_class *class, | |||
350 | 346 | ||
351 | return count; | 347 | return count; |
352 | } | 348 | } |
353 | static SYSDEV_CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); | 349 | static CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); |
354 | 350 | ||
355 | static int memory_probe_init(void) | 351 | static int memory_probe_init(void) |
356 | { | 352 | { |
357 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 353 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, |
358 | &attr_probe.attr); | 354 | &class_attr_probe.attr); |
359 | } | 355 | } |
360 | #else | 356 | #else |
361 | static inline int memory_probe_init(void) | 357 | static inline int memory_probe_init(void) |
@@ -371,9 +367,7 @@ static inline int memory_probe_init(void) | |||
371 | 367 | ||
372 | /* Soft offline a page */ | 368 | /* Soft offline a page */ |
373 | static ssize_t | 369 | static ssize_t |
374 | store_soft_offline_page(struct sysdev_class *class, | 370 | store_soft_offline_page(struct class *class, const char *buf, size_t count) |
375 | struct sysdev_class_attribute *class_attr, | ||
376 | const char *buf, size_t count) | ||
377 | { | 371 | { |
378 | int ret; | 372 | int ret; |
379 | u64 pfn; | 373 | u64 pfn; |
@@ -390,9 +384,7 @@ store_soft_offline_page(struct sysdev_class *class, | |||
390 | 384 | ||
391 | /* Forcibly offline a page, including killing processes. */ | 385 | /* Forcibly offline a page, including killing processes. */ |
392 | static ssize_t | 386 | static ssize_t |
393 | store_hard_offline_page(struct sysdev_class *class, | 387 | store_hard_offline_page(struct class *class, const char *buf, size_t count) |
394 | struct sysdev_class_attribute *class_attr, | ||
395 | const char *buf, size_t count) | ||
396 | { | 388 | { |
397 | int ret; | 389 | int ret; |
398 | u64 pfn; | 390 | u64 pfn; |
@@ -405,18 +397,18 @@ store_hard_offline_page(struct sysdev_class *class, | |||
405 | return ret ? ret : count; | 397 | return ret ? ret : count; |
406 | } | 398 | } |
407 | 399 | ||
408 | static SYSDEV_CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); | 400 | static CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); |
409 | static SYSDEV_CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); | 401 | static CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); |
410 | 402 | ||
411 | static __init int memory_fail_init(void) | 403 | static __init int memory_fail_init(void) |
412 | { | 404 | { |
413 | int err; | 405 | int err; |
414 | 406 | ||
415 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, | 407 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, |
416 | &attr_soft_offline_page.attr); | 408 | &class_attr_soft_offline_page.attr); |
417 | if (!err) | 409 | if (!err) |
418 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, | 410 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, |
419 | &attr_hard_offline_page.attr); | 411 | &class_attr_hard_offline_page.attr); |
420 | return err; | 412 | return err; |
421 | } | 413 | } |
422 | #else | 414 | #else |