Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247788
b: refs/heads/master
c: bd68ccb
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Eremin-Solenikov authored and Herbert Xu committed May 4, 2011
1 parent 2db45fa commit fe7d387
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 0200f3ecc19660bebeabbcbaf212957fcf1dbf8f
refs/heads/master: bd68ccb390f0d91e26e6f3252ba457ee4e06974a
9 changes: 9 additions & 0 deletions trunk/drivers/char/hw_random/amd-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ static int __init mod_init(void)
pmbase &= 0x0000FF00;
if (pmbase == 0)
goto out;
if (!request_region(pmbase + 0xF0, 8, "AMD HWRNG")) {
dev_err(&pdev->dev, "AMD HWRNG region 0x%x already in use!\n",
pmbase + 0xF0);
err = -EBUSY;
goto out;
}
amd_rng.priv = (unsigned long)pmbase;
amd_pdev = pdev;

Expand All @@ -141,6 +147,7 @@ static int __init mod_init(void)
if (err) {
printk(KERN_ERR PFX "RNG registering failed (%d)\n",
err);
release_region(pmbase + 0xF0, 8);
goto out;
}
out:
Expand All @@ -149,6 +156,8 @@ static int __init mod_init(void)

static void __exit mod_exit(void)
{
u32 pmbase = (unsigned long)amd_rng.priv;
release_region(pmbase + 0xF0, 8);
hwrng_unregister(&amd_rng);
}

Expand Down

0 comments on commit fe7d387

Please sign in to comment.