mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [v1] reset: starfive: Fixed access the empty member on JH7110 SoC
@ 2024-09-04  2:46 Changhuang Liang
  2024-09-04  3:35 ` Hal Feng
  0 siblings, 1 reply; 2+ messages in thread
From: Changhuang Liang @ 2024-09-04  2:46 UTC (permalink / raw)
  To: Emil Renner Berthing, Hal Feng, Philipp Zabel
  Cc: Conor Dooley, linux-kernel, linux-riscv

data->asserted will be NULL on JH7110 SoC since commit 82327b127d41
("reset: starfive: Add StarFive JH7110 reset driver") be added. Add
the judgment conditions to avoid errors.

Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
---
 drivers/reset/starfive/reset-starfive-jh71x0.c | 3 +++
 1 file changed, 3 insertions(+)

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);
 }
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [v1] reset: starfive: Fixed access the empty member on JH7110 SoC
  2024-09-04  2:46 [v1] reset: starfive: Fixed access the empty member on JH7110 SoC Changhuang Liang
@ 2024-09-04  3:35 ` Hal Feng
  0 siblings, 0 replies; 2+ messages in thread
From: Hal Feng @ 2024-09-04  3:35 UTC (permalink / raw)
  To: Changhuang Liang, Emil Renner Berthing, Philipp Zabel
  Cc: Conor Dooley, linux-kernel, linux-riscv

> On 04.09.24 10:47, Changhuang Liang wrote:
> data->asserted will be NULL on JH7110 SoC since commit 82327b127d41
> ("reset: starfive: Add StarFive JH7110 reset driver") be added. Add the
> judgment conditions to avoid errors.
> 
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> ---
>  drivers/reset/starfive/reset-starfive-jh71x0.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> 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);  }

Looks good. Maybe the commit message can be improved.

Acked-by: Hal Feng <hal.feng@starfivetech.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-04  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-04  2:46 [v1] reset: starfive: Fixed access the empty member on JH7110 SoC Changhuang Liang
2024-09-04  3:35 ` Hal Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®