.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright 2013 Michael Ellerman, Guo Chao, IBM Corp. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or |
---|
5 | | - * modify it under the terms of the GNU General Public License |
---|
6 | | - * as published by the Free Software Foundation; either version |
---|
7 | | - * 2 of the License, or (at your option) any later version. |
---|
8 | 4 | */ |
---|
9 | 5 | |
---|
10 | 6 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
37 | 33 | .read = powernv_rng_read, |
---|
38 | 34 | }; |
---|
39 | 35 | |
---|
40 | | -static int powernv_rng_remove(struct platform_device *pdev) |
---|
41 | | -{ |
---|
42 | | - hwrng_unregister(&powernv_hwrng); |
---|
43 | | - |
---|
44 | | - return 0; |
---|
45 | | -} |
---|
46 | | - |
---|
47 | 36 | static int powernv_rng_probe(struct platform_device *pdev) |
---|
48 | 37 | { |
---|
49 | 38 | int rc; |
---|
50 | 39 | |
---|
51 | | - rc = hwrng_register(&powernv_hwrng); |
---|
| 40 | + rc = devm_hwrng_register(&pdev->dev, &powernv_hwrng); |
---|
52 | 41 | if (rc) { |
---|
53 | 42 | /* We only register one device, ignore any others */ |
---|
54 | 43 | if (rc == -EEXIST) |
---|
.. | .. |
---|
74 | 63 | .of_match_table = powernv_rng_match, |
---|
75 | 64 | }, |
---|
76 | 65 | .probe = powernv_rng_probe, |
---|
77 | | - .remove = powernv_rng_remove, |
---|
78 | 66 | }; |
---|
79 | 67 | module_platform_driver(powernv_rng_driver); |
---|
80 | 68 | |
---|