Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304642
b: refs/heads/master
c: bb4206f
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed May 14, 2012
1 parent f7316ea commit 48cab62
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 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: 484dd30e016eb425b0de871357fff2c9bb93be45
refs/heads/master: bb4206f2042d950a7af1560200af81aa59172a84
44 changes: 27 additions & 17 deletions trunk/drivers/staging/android/persistent_ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,28 +378,15 @@ static int __init persistent_ram_buffer_init(const char *name,
return -EINVAL;
}

static __init
struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc)
static int __init persistent_ram_post_init(struct persistent_ram_zone *prz, bool ecc)
{
struct persistent_ram_zone *prz;
int ret = -ENOMEM;

prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL);
if (!prz) {
pr_err("persistent_ram: failed to allocate persistent ram zone\n");
goto err;
}

ret = persistent_ram_buffer_init(dev_name(dev), prz);
if (ret) {
pr_err("persistent_ram: failed to initialize buffer\n");
goto err;
}
int ret;

prz->ecc = ecc;

ret = persistent_ram_init_ecc(prz, prz->buffer_size);
if (ret)
goto err;
return ret;

if (prz->buffer->sig == PERSISTENT_RAM_SIG) {
if (buffer_size(prz) > prz->buffer_size ||
Expand All @@ -422,6 +409,29 @@ struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc)
atomic_set(&prz->buffer->start, 0);
atomic_set(&prz->buffer->size, 0);

return 0;
}

static __init
struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc)
{
struct persistent_ram_zone *prz;
int ret = -ENOMEM;

prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL);
if (!prz) {
pr_err("persistent_ram: failed to allocate persistent ram zone\n");
goto err;
}

ret = persistent_ram_buffer_init(dev_name(dev), prz);
if (ret) {
pr_err("persistent_ram: failed to initialize buffer\n");
goto err;
}

persistent_ram_post_init(prz, ecc);

return prz;
err:
kfree(prz);
Expand Down

0 comments on commit 48cab62

Please sign in to comment.