diff mbox series

[v3] reset: starfive: jh71x0: Fix accessing the empty member on JH7110 SoC

Message ID 20240925112442.1732416-1-changhuang.liang@starfivetech.com (mailing list archive)
State Handled Elsewhere
Headers show
Series [v3] reset: starfive: jh71x0: Fix accessing the empty member on JH7110 SoC | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 132.15s
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1309.61s
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1562.34s
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 20.68s
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 22.45s
conchuod/patch-1-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.46s
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 41.80s
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.56s
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.03s

Commit Message

Changhuang Liang Sept. 25, 2024, 11:24 a.m. UTC
data->asserted will be NULL on JH7110 SoC since commit 82327b127d41
("reset: starfive: Add StarFive JH7110 reset driver") was added. Add
the judgment condition to avoid errors when calling reset_control_status
on JH7110 SoC.

Fixes: 82327b127d41 ("reset: starfive: Add StarFive JH7110 reset driver")
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Acked-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
---

Add Fixes.

 drivers/reset/starfive/reset-starfive-jh71x0.c | 3 +++
 1 file changed, 3 insertions(+)

--
2.25.1

Comments

Philipp Zabel Sept. 30, 2024, 4:47 p.m. UTC | #1
On Mi, 2024-09-25 at 04:24 -0700, Changhuang Liang wrote:
> data->asserted will be NULL on JH7110 SoC since commit 82327b127d41
> ("reset: starfive: Add StarFive JH7110 reset driver") was added. Add
> the judgment condition to avoid errors when calling reset_control_status
> on JH7110 SoC.
> 
> Fixes: 82327b127d41 ("reset: starfive: Add StarFive JH7110 reset driver")
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> Acked-by: Hal Feng <hal.feng@starfivetech.com>
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

Applied to reset/fixes, thanks!

[1/1] reset: starfive: jh71x0: Fix accessing the empty member on JH7110 SoC
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=2cf596636607

regards
Philipp
diff mbox series

Patch

diff --git a/drivers/reset/starfive/reset-starfive-jh71x0.c b/drivers/reset/starfive/reset-starfive-jh71x0.c
index 55bbbd2de52c..29ce3486752f 100644
--- a/drivers/reset/starfive/reset-starfive-jh71x0.c
+++ b/drivers/reset/starfive/reset-starfive-jh71x0.c
@@ -94,6 +94,9 @@  static int jh71x0_reset_status(struct reset_controller_dev *rcdev,
 	void __iomem *reg_status = data->status + offset * sizeof(u32);
 	u32 value = readl(reg_status);

+	if (!data->asserted)
+		return !(value & mask);
+
 	return !((value ^ data->asserted[offset]) & mask);
 }