[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190323211612.860-5-fparent@baylibre.com>
Date: Sat, 23 Mar 2019 22:15:52 +0100
From: Fabien Parent <fparent@...libre.com>
To: matthias.bgg@...il.com, robh+dt@...nel.org, mark.rutland@....com
Cc: sean.wang@...nel.org, ryder.lee@...iatek.com,
hsin-hsiung.wang@...iatek.com, wenzhen.yu@...iatek.com,
chaotian.jing@...iatek.com, yong.mao@...iatek.com,
jjian.zhou@...iatek.com, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-mmc@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-serial@...r.kernel.org,
linux-spi@...r.kernel.org, linux-watchdog@...r.kernel.org,
linux-clk@...r.kernel.org, stephane.leprovost@...iatek.com,
Fabien Parent <fparent@...libre.com>
Subject: [PATCH 04/24] soc: mediatek: pwrap: add missing check on rstc
The variable rstc is set only when the SoC PWRAP have the
PWRAP_CAP_RESET capability. Check whether rstc is set before
using it to avoid errors.
Signed-off-by: Fabien Parent <fparent@...libre.com>
---
drivers/soc/mediatek/mtk-pmic-wrap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index 8236a6c87e19..b3ba2301f569 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -1478,7 +1478,8 @@ static int pwrap_init(struct pmic_wrapper *wrp)
{
int ret;
- reset_control_reset(wrp->rstc);
+ if (wrp->rstc)
+ reset_control_reset(wrp->rstc);
if (wrp->rstc_bridge)
reset_control_reset(wrp->rstc_bridge);
--
2.20.1
Powered by blists - more mailing lists