hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/char/hw_random/mtk-rng.c
....@@ -1,17 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for Mediatek Hardware Random Number Generator
34 *
45 * Copyright (C) 2017 Sean Wang <sean.wang@mediatek.com>
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License as
8
- * published by the Free Software Foundation; either version 2 of
9
- * the License, or (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
156 */
167 #define MTK_RNG_DEV KBUILD_MODNAME
178
....@@ -114,15 +105,8 @@
114105
115106 static int mtk_rng_probe(struct platform_device *pdev)
116107 {
117
- struct resource *res;
118108 int ret;
119109 struct mtk_rng *priv;
120
-
121
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
122
- if (!res) {
123
- dev_err(&pdev->dev, "no iomem resource\n");
124
- return -ENXIO;
125
- }
126110
127111 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
128112 if (!priv)
....@@ -144,7 +128,7 @@
144128 return ret;
145129 }
146130
147
- priv->base = devm_ioremap_resource(&pdev->dev, res);
131
+ priv->base = devm_platform_ioremap_resource(pdev, 0);
148132 if (IS_ERR(priv->base))
149133 return PTR_ERR(priv->base);
150134