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>
This commit is contained in:
Fabien Parent 2019-03-23 22:15:52 +01:00 committed by Matthias Brugger
parent 4bad8b0709
commit a51f4c031d

View File

@ -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);