Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304643
b: refs/heads/master
c: 8cf5aff
h: refs/heads/master
i:
  304641: f7316ea
  304639: f9ef611
v: v3
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed May 14, 2012
1 parent 48cab62 commit 6465aab
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb4206f2042d950a7af1560200af81aa59172a84
refs/heads/master: 8cf5aff89e5991aa4bec903b6dbab7d248047d98
26 changes: 26 additions & 0 deletions trunk/drivers/staging/android/persistent_ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,32 @@ static int __init persistent_ram_post_init(struct persistent_ram_zone *prz, bool
return 0;
}

struct persistent_ram_zone * __init persistent_ram_new(phys_addr_t start,
size_t size,
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_map(start, size, prz);
if (ret)
goto err;

persistent_ram_post_init(prz, ecc);
persistent_ram_update_header_ecc(prz);

return prz;
err:
kfree(prz);
return ERR_PTR(ret);
}

static __init
struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc)
{
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/staging/android/persistent_ram.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/types.h>
#include <linux/init.h>

struct persistent_ram_buffer;

Expand Down Expand Up @@ -62,6 +63,9 @@ struct persistent_ram_zone {

int persistent_ram_early_init(struct persistent_ram *ram);

struct persistent_ram_zone * __init persistent_ram_new(phys_addr_t start,
size_t size,
bool ecc);
struct persistent_ram_zone *persistent_ram_init_ringbuffer(struct device *dev,
bool ecc);

Expand Down

0 comments on commit 6465aab

Please sign in to comment.