Commit 2cf59663 authored by Changhuang Liang's avatar Changhuang Liang Committed by Philipp Zabel

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

data->asserted will be NULL on JH7110 SoC since commit 82327b12
("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: 82327b12 ("reset: starfive: Add StarFive JH7110 reset driver")
Signed-off-by: default avatarChanghuang Liang <changhuang.liang@starfivetech.com>
Acked-by: default avatarHal Feng <hal.feng@starfivetech.com>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20240925112442.1732416-1-changhuang.liang@starfivetech.comSigned-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent e7b71bf1
...@@ -94,6 +94,9 @@ static int jh71x0_reset_status(struct reset_controller_dev *rcdev, ...@@ -94,6 +94,9 @@ static int jh71x0_reset_status(struct reset_controller_dev *rcdev,
void __iomem *reg_status = data->status + offset * sizeof(u32); void __iomem *reg_status = data->status + offset * sizeof(u32);
u32 value = readl(reg_status); u32 value = readl(reg_status);
if (!data->asserted)
return !(value & mask);
return !((value ^ data->asserted[offset]) & mask); return !((value ^ data->asserted[offset]) & mask);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment