Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235076
b: refs/heads/master
c: c652759
h: refs/heads/master
v: v3
  • Loading branch information
Julia Lawall authored and Herbert Xu committed Feb 16, 2011
1 parent c31ded3 commit c6839c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 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: fc9044e2db8c13746cd886d6276028b27ed5c78e
refs/heads/master: c652759b6a27be04ef5d747d81e8c36cde7f55d1
14 changes: 6 additions & 8 deletions trunk/drivers/char/hw_random/omap-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static struct hwrng omap_rng_ops = {

static int __devinit omap_rng_probe(struct platform_device *pdev)
{
struct resource *res, *mem;
struct resource *res;
int ret;

/*
Expand All @@ -116,14 +116,12 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
if (!res)
return -ENOENT;

mem = request_mem_region(res->start, resource_size(res),
pdev->name);
if (mem == NULL) {
if (!request_mem_region(res->start, resource_size(res), pdev->name)) {
ret = -EBUSY;
goto err_region;
}

dev_set_drvdata(&pdev->dev, mem);
dev_set_drvdata(&pdev->dev, res);
rng_base = ioremap(res->start, resource_size(res));
if (!rng_base) {
ret = -ENOMEM;
Expand All @@ -146,7 +144,7 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
iounmap(rng_base);
rng_base = NULL;
err_ioremap:
release_resource(mem);
release_mem_region(res->start, resource_size(res));
err_region:
if (cpu_is_omap24xx()) {
clk_disable(rng_ick);
Expand All @@ -157,7 +155,7 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)

static int __exit omap_rng_remove(struct platform_device *pdev)
{
struct resource *mem = dev_get_drvdata(&pdev->dev);
struct resource *res = dev_get_drvdata(&pdev->dev);

hwrng_unregister(&omap_rng_ops);

Expand All @@ -170,7 +168,7 @@ static int __exit omap_rng_remove(struct platform_device *pdev)
clk_put(rng_ick);
}

release_resource(mem);
release_mem_region(res->start, resource_size(res));
rng_base = NULL;

return 0;
Expand Down

0 comments on commit c6839c7

Please sign in to comment.