diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/hw_random/picoxcell-rng.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/char/hw_random/picoxcell-rng.c b/drivers/char/hw_random/picoxcell-rng.c index 3d4c2293c6f5..c03beeeb1aea 100644 --- a/drivers/char/hw_random/picoxcell-rng.c +++ b/drivers/char/hw_random/picoxcell-rng.c | |||
@@ -104,22 +104,9 @@ static int picoxcell_trng_probe(struct platform_device *pdev) | |||
104 | int ret; | 104 | int ret; |
105 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 105 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
106 | 106 | ||
107 | if (!mem) { | 107 | rng_base = devm_ioremap_resource(&pdev->dev, mem); |
108 | dev_warn(&pdev->dev, "no memory resource\n"); | 108 | if (IS_ERR(rng_base)) |
109 | return -ENOMEM; | 109 | return PTR_ERR(rng_base); |
110 | } | ||
111 | |||
112 | if (!devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem), | ||
113 | "picoxcell_trng")) { | ||
114 | dev_warn(&pdev->dev, "unable to request io mem\n"); | ||
115 | return -EBUSY; | ||
116 | } | ||
117 | |||
118 | rng_base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); | ||
119 | if (!rng_base) { | ||
120 | dev_warn(&pdev->dev, "unable to remap io mem\n"); | ||
121 | return -ENOMEM; | ||
122 | } | ||
123 | 110 | ||
124 | rng_clk = clk_get(&pdev->dev, NULL); | 111 | rng_clk = clk_get(&pdev->dev, NULL); |
125 | if (IS_ERR(rng_clk)) { | 112 | if (IS_ERR(rng_clk)) { |