diff options
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r-- | drivers/base/memory.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index bd025059711f..2f8691511190 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -44,7 +44,7 @@ static int memory_uevent(struct kset *kset, struct kobject *obj, struct kobj_uev | |||
44 | return retval; | 44 | return retval; |
45 | } | 45 | } |
46 | 46 | ||
47 | static struct kset_uevent_ops memory_uevent_ops = { | 47 | static const struct kset_uevent_ops memory_uevent_ops = { |
48 | .name = memory_uevent_name, | 48 | .name = memory_uevent_name, |
49 | .uevent = memory_uevent, | 49 | .uevent = memory_uevent, |
50 | }; | 50 | }; |
@@ -309,17 +309,18 @@ 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 class *class, char *buf) | 312 | print_block_size(struct sysdev_class *class, struct sysdev_class_attribute *attr, |
313 | char *buf) | ||
313 | { | 314 | { |
314 | return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE); | 315 | return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE); |
315 | } | 316 | } |
316 | 317 | ||
317 | static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); | 318 | static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); |
318 | 319 | ||
319 | static int block_size_init(void) | 320 | static int block_size_init(void) |
320 | { | 321 | { |
321 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 322 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, |
322 | &class_attr_block_size_bytes.attr); | 323 | &attr_block_size_bytes.attr); |
323 | } | 324 | } |
324 | 325 | ||
325 | /* | 326 | /* |
@@ -330,7 +331,8 @@ static int block_size_init(void) | |||
330 | */ | 331 | */ |
331 | #ifdef CONFIG_ARCH_MEMORY_PROBE | 332 | #ifdef CONFIG_ARCH_MEMORY_PROBE |
332 | static ssize_t | 333 | static ssize_t |
333 | memory_probe_store(struct class *class, const char *buf, size_t count) | 334 | memory_probe_store(struct class *class, struct class_attribute *attr, |
335 | const char *buf, size_t count) | ||
334 | { | 336 | { |
335 | u64 phys_addr; | 337 | u64 phys_addr; |
336 | int nid; | 338 | int nid; |
@@ -367,7 +369,9 @@ static inline int memory_probe_init(void) | |||
367 | 369 | ||
368 | /* Soft offline a page */ | 370 | /* Soft offline a page */ |
369 | static ssize_t | 371 | static ssize_t |
370 | store_soft_offline_page(struct class *class, const char *buf, size_t count) | 372 | store_soft_offline_page(struct class *class, |
373 | struct class_attribute *attr, | ||
374 | const char *buf, size_t count) | ||
371 | { | 375 | { |
372 | int ret; | 376 | int ret; |
373 | u64 pfn; | 377 | u64 pfn; |
@@ -384,7 +388,9 @@ store_soft_offline_page(struct class *class, const char *buf, size_t count) | |||
384 | 388 | ||
385 | /* Forcibly offline a page, including killing processes. */ | 389 | /* Forcibly offline a page, including killing processes. */ |
386 | static ssize_t | 390 | static ssize_t |
387 | store_hard_offline_page(struct class *class, const char *buf, size_t count) | 391 | store_hard_offline_page(struct class *class, |
392 | struct class_attribute *attr, | ||
393 | const char *buf, size_t count) | ||
388 | { | 394 | { |
389 | int ret; | 395 | int ret; |
390 | u64 pfn; | 396 | u64 pfn; |