aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r--drivers/base/memory.c20
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
47static struct kset_uevent_ops memory_uevent_ops = { 47static 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 */
311static ssize_t 311static ssize_t
312print_block_size(struct class *class, char *buf) 312print_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
317static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); 318static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);
318 319
319static int block_size_init(void) 320static 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
332static ssize_t 333static ssize_t
333memory_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)
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 */
369static ssize_t 371static ssize_t
370store_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)
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. */
386static ssize_t 390static ssize_t
387store_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)
388{ 394{
389 int ret; 395 int ret;
390 u64 pfn; 396 u64 pfn;