diff options
author | Fabien Parent <fparent@baylibre.com> | 2019-03-24 00:15:52 +0300 |
---|---|---|
committer | Matthias Brugger <matthias.bgg@gmail.com> | 2019-04-12 20:42:41 +0300 |
commit | a51f4c031de35bc30d56bede232ffd2ae9c5fd6d (patch) | |
tree | d02ae03ee3c62fe5742d94067f9b381e901a45b4 | |
parent | 4bad8b0709f59cc210207201b2cba86e4fc28bf5 (diff) | |
download | linux-a51f4c031de35bc30d56bede232ffd2ae9c5fd6d.tar.xz |
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@baylibre.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
-rw-r--r-- | drivers/soc/mediatek/mtk-pmic-wrap.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |