From: Fabien Parent Date: Sat, 23 Mar 2019 21:15:52 +0000 (+0100) Subject: soc: mediatek: pwrap: add missing check on rstc X-Git-Tag: v5.2-rc1~44^2~3^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a51f4c031de35bc30d56bede232ffd2ae9c5fd6d;p=thirdparty%2Flinux.git 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 Signed-off-by: Matthias Brugger --- diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c index 8236a6c87e19f..b3ba2301f569b 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);