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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1478,6 +1478,7 @@ static int pwrap_init(struct pmic_wrapper *wrp)
{
	int ret;

	if (wrp->rstc)
		reset_control_reset(wrp->rstc);
	if (wrp->rstc_bridge)
		reset_control_reset(wrp->rstc_bridge);