mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-09-21 03:39:21 +00:00
Reorder hwRNG patches to match current naming. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org> Link: https://github.com/openwrt/openwrt/pull/19989 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
54 lines
1.7 KiB
Diff
54 lines
1.7 KiB
Diff
From 9c2797093a4095a1d686b6c51fbd321a627855ee Mon Sep 17 00:00:00 2001
|
|
From: Martin Kaiser <martin@kaiser.cx>
|
|
Date: Wed, 21 Aug 2024 20:12:34 +0200
|
|
Subject: [PATCH] hwrng: rockchip - rst is used only during probe
|
|
|
|
The driver uses the rst variable only for an initial reset when the chip
|
|
is probed. There's no need to store rst in the driver's private data, we
|
|
can make it a local variable in the probe function.
|
|
|
|
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
|
|
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
---
|
|
drivers/char/hw_random/rockchip-rng.c | 13 ++++++-------
|
|
1 file changed, 6 insertions(+), 7 deletions(-)
|
|
|
|
--- a/drivers/char/hw_random/rockchip-rng.c
|
|
+++ b/drivers/char/hw_random/rockchip-rng.c
|
|
@@ -52,7 +52,6 @@
|
|
struct rk_rng {
|
|
struct hwrng rng;
|
|
void __iomem *base;
|
|
- struct reset_control *rst;
|
|
int clk_num;
|
|
struct clk_bulk_data *clk_bulks;
|
|
};
|
|
@@ -132,6 +131,7 @@ out:
|
|
static int rk_rng_probe(struct platform_device *pdev)
|
|
{
|
|
struct device *dev = &pdev->dev;
|
|
+ struct reset_control *rst;
|
|
struct rk_rng *rk_rng;
|
|
int ret;
|
|
|
|
@@ -148,14 +148,13 @@ static int rk_rng_probe(struct platform_
|
|
return dev_err_probe(dev, rk_rng->clk_num,
|
|
"Failed to get clks property\n");
|
|
|
|
- rk_rng->rst = devm_reset_control_array_get_exclusive(&pdev->dev);
|
|
- if (IS_ERR(rk_rng->rst))
|
|
- return dev_err_probe(dev, PTR_ERR(rk_rng->rst),
|
|
- "Failed to get reset property\n");
|
|
+ rst = devm_reset_control_array_get_exclusive(&pdev->dev);
|
|
+ if (IS_ERR(rst))
|
|
+ return dev_err_probe(dev, PTR_ERR(rst), "Failed to get reset property\n");
|
|
|
|
- reset_control_assert(rk_rng->rst);
|
|
+ reset_control_assert(rst);
|
|
udelay(2);
|
|
- reset_control_deassert(rk_rng->rst);
|
|
+ reset_control_deassert(rst);
|
|
|
|
platform_set_drvdata(pdev, rk_rng);
|
|
|