.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Nomadik RNG support |
---|
3 | 4 | * Copyright 2009 Alessandro Rubini |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License as published by |
---|
7 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
8 | | - * (at your option) any later version. |
---|
9 | 5 | */ |
---|
10 | 6 | |
---|
11 | 7 | #include <linux/kernel.h> |
---|
.. | .. |
---|
61 | 57 | if (!base) |
---|
62 | 58 | goto out_release; |
---|
63 | 59 | nmk_rng.priv = (unsigned long)base; |
---|
64 | | - ret = hwrng_register(&nmk_rng); |
---|
| 60 | + ret = devm_hwrng_register(&dev->dev, &nmk_rng); |
---|
65 | 61 | if (ret) |
---|
66 | 62 | goto out_release; |
---|
67 | 63 | return 0; |
---|
.. | .. |
---|
69 | 65 | out_release: |
---|
70 | 66 | amba_release_regions(dev); |
---|
71 | 67 | out_clk: |
---|
72 | | - clk_disable(rng_clk); |
---|
| 68 | + clk_disable_unprepare(rng_clk); |
---|
73 | 69 | return ret; |
---|
74 | 70 | } |
---|
75 | 71 | |
---|
76 | | -static int nmk_rng_remove(struct amba_device *dev) |
---|
| 72 | +static void nmk_rng_remove(struct amba_device *dev) |
---|
77 | 73 | { |
---|
78 | | - hwrng_unregister(&nmk_rng); |
---|
79 | 74 | amba_release_regions(dev); |
---|
80 | | - clk_disable(rng_clk); |
---|
81 | | - return 0; |
---|
| 75 | + clk_disable_unprepare(rng_clk); |
---|
82 | 76 | } |
---|
83 | 77 | |
---|
84 | | -static struct amba_id nmk_rng_ids[] = { |
---|
| 78 | +static const struct amba_id nmk_rng_ids[] = { |
---|
85 | 79 | { |
---|
86 | 80 | .id = 0x000805e1, |
---|
87 | 81 | .mask = 0x000fffff, /* top bits are rev and cfg: accept all */ |
---|