Skip to content

Commit 2cf5966

Browse files
changhuangliangpH5
authored andcommitted
reset: starfive: jh71x0: Fix accessing the empty member on JH7110 SoC
data->asserted will be NULL on JH7110 SoC since commit 82327b1 ("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: 82327b1 ("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> Link: https://lore.kernel.org/r/20240925112442.1732416-1-changhuang.liang@starfivetech.com Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
1 parent e7b71bf commit 2cf5966

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/reset/starfive/reset-starfive-jh71x0.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ static int jh71x0_reset_status(struct reset_controller_dev *rcdev,
9494
void __iomem *reg_status = data->status + offset * sizeof(u32);
9595
u32 value = readl(reg_status);
9696

97+
if (!data->asserted)
98+
return !(value & mask);
99+
97100
return !((value ^ data->asserted[offset]) & mask);
98101
}
99102

0 commit comments

Comments
 (0)