Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42841
b: refs/heads/master
c: 28ec24e
h: refs/heads/master
i:
  42839: 8389d7a
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 7, 2006
1 parent 9d34ade commit 13d518b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d75565f1e8f098b80a34ccf70db450f60618ec8
refs/heads/master: 28ec24e23229ae3d333f8d7f0e6b31fa8ea7bf46
34 changes: 23 additions & 11 deletions trunk/drivers/base/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,8 @@ static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);

static int block_size_init(void)
{
sysfs_create_file(&memory_sysdev_class.kset.kobj,
&class_attr_block_size_bytes.attr);
return 0;
return sysfs_create_file(&memory_sysdev_class.kset.kobj,
&class_attr_block_size_bytes.attr);
}

/*
Expand Down Expand Up @@ -323,12 +322,14 @@ static CLASS_ATTR(probe, 0700, NULL, memory_probe_store);

static int memory_probe_init(void)
{
sysfs_create_file(&memory_sysdev_class.kset.kobj,
&class_attr_probe.attr);
return 0;
return sysfs_create_file(&memory_sysdev_class.kset.kobj,
&class_attr_probe.attr);
}
#else
#define memory_probe_init(...) do {} while (0)
static inline int memory_probe_init(void)
{
return 0;
}
#endif

/*
Expand Down Expand Up @@ -431,9 +432,12 @@ int __init memory_dev_init(void)
{
unsigned int i;
int ret;
int err;

memory_sysdev_class.kset.uevent_ops = &memory_uevent_ops;
ret = sysdev_class_register(&memory_sysdev_class);
if (ret)
goto out;

/*
* Create entries for memory sections that were found
Expand All @@ -442,11 +446,19 @@ int __init memory_dev_init(void)
for (i = 0; i < NR_MEM_SECTIONS; i++) {
if (!valid_section_nr(i))
continue;
add_memory_block(0, __nr_to_section(i), MEM_ONLINE, 0);
err = add_memory_block(0, __nr_to_section(i), MEM_ONLINE, 0);
if (!ret)
ret = err;
}

memory_probe_init();
block_size_init();

err = memory_probe_init();
if (!ret)
ret = err;
err = block_size_init();
if (!ret)
ret = err;
out:
if (ret)
printk(KERN_ERR "%s() failed: %d\n", __FUNCTION__, ret);
return ret;
}

0 comments on commit 13d518b

Please sign in to comment.