Commit a51f4c03 authored by Fabien Parent's avatar Fabien Parent Committed by Matthias Brugger

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: default avatarFabien Parent <fparent@baylibre.com>
Signed-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
parent 4bad8b07
...@@ -1478,7 +1478,8 @@ static int pwrap_init(struct pmic_wrapper *wrp) ...@@ -1478,7 +1478,8 @@ static int pwrap_init(struct pmic_wrapper *wrp)
{ {
int ret; int ret;
reset_control_reset(wrp->rstc); if (wrp->rstc)
reset_control_reset(wrp->rstc);
if (wrp->rstc_bridge) if (wrp->rstc_bridge)
reset_control_reset(wrp->rstc_bridge); reset_control_reset(wrp->rstc_bridge);
......
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