aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 10:36:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 10:36:31 -0500
commitf8c7e6c2038a96f427911264a0c1448c9e3c2a9e (patch)
tree2013405da9810dc4d9a5e77497f1afadb5b8d5d3
parentc9140487b4601ea0b4479af3d92ceb0cda2c691f (diff)
parentbd796671f093d5b1841d383674d5650f5ec6c9c6 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: Revert "sysdev: fix prototype for memory_sysdev_class show/store functions" driver-core: fix devtmpfs crash on s390
-rw-r--r--drivers/base/devtmpfs.c3
-rw-r--r--drivers/base/memory.c32
2 files changed, 14 insertions, 21 deletions
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index 090dd4851301..42ae452b36b0 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -354,6 +354,7 @@ int __init devtmpfs_init(void)
354{ 354{
355 int err; 355 int err;
356 struct vfsmount *mnt; 356 struct vfsmount *mnt;
357 char options[] = "mode=0755";
357 358
358 err = register_filesystem(&dev_fs_type); 359 err = register_filesystem(&dev_fs_type);
359 if (err) { 360 if (err) {
@@ -362,7 +363,7 @@ int __init devtmpfs_init(void)
362 return err; 363 return err;
363 } 364 }
364 365
365 mnt = kern_mount_data(&dev_fs_type, "mode=0755"); 366 mnt = kern_mount_data(&dev_fs_type, options);
366 if (IS_ERR(mnt)) { 367 if (IS_ERR(mnt)) {
367 err = PTR_ERR(mnt); 368 err = PTR_ERR(mnt);
368 printk(KERN_ERR "devtmpfs: unable to create devtmpfs %i\n", err); 369 printk(KERN_ERR "devtmpfs: unable to create devtmpfs %i\n", err);
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 */
311static ssize_t 311static ssize_t
312print_block_size(struct sysdev_class *class, 312print_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
319static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); 317static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);
320 318
321static int block_size_init(void) 319static 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
334static ssize_t 332static ssize_t
335memory_probe_store(struct sysdev_class *class, 333memory_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}
353static SYSDEV_CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); 349static CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store);
354 350
355static int memory_probe_init(void) 351static 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
361static inline int memory_probe_init(void) 357static 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 */
373static ssize_t 369static ssize_t
374store_soft_offline_page(struct sysdev_class *class, 370store_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. */
392static ssize_t 386static ssize_t
393store_hard_offline_page(struct sysdev_class *class, 387store_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
408static SYSDEV_CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); 400static CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page);
409static SYSDEV_CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); 401static CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page);
410 402
411static __init int memory_fail_init(void) 403static __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