From patchwork Sat Mar 23 21:15:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 10867041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C77318EC for ; Sat, 23 Mar 2019 21:17:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B093293A7 for ; Sat, 23 Mar 2019 21:17:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 571D52870C; Sat, 23 Mar 2019 21:17:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E5DEE293A7 for ; Sat, 23 Mar 2019 21:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ePD89g0m02zVBIrlUeY1hX/QMqe4YFrvwcuktSdNPsU=; b=JizJUvgoS6RTQG pgptyGmH+GG/GDdOtdyxrlZqQHcpwI8HFtnfl20h3iaK/C7B2+LVMvzshQ4NTKo3eQlGoDCzvqDrP Lw6z7LSZwVFkP3TEV7brI+0++Q8msNnJKE0twV02pLVmzqo54hSxgAE4obQVQU/9aIN9LXdQF5a/D KU/TsPe5AIvhdf+0/ufmlTV8jg4SuE9JWACPCJXZxp5uJO5Q954Nem1vK6xs55fUZ4YQKv6u0Knho GmVHDQV817OyPMU6bHQulQu1yYfjYMu3W4CL6VjiJo4P2M/jYA9lIVqaVqwhBb8V1EfdiS1JyyuSD jLqxIRh2zMTYTj9xJMVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7o1I-0004m8-TX; Sat, 23 Mar 2019 21:17:36 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7o0V-0003lS-GV for linux-mediatek@lists.infradead.org; Sat, 23 Mar 2019 21:16:54 +0000 Received: by mail-wm1-x344.google.com with SMTP id z6so6738862wmi.0 for ; Sat, 23 Mar 2019 14:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mihn/aKPHlaD2O85e+r6TuyfAnA4mSgmIhLj+KW2M0s=; b=gmEfLE7TIBFCp0klT2SSwh+BuFEP50TfMJwf5RlXXSoONQIaYgb8v7uYW7P9dlt0/T VzU7a800z4kGX9EhFE1H09yClH6B7PdwTyqc2nXEh6+Jw1ls5xC05KWH/gOsSARuSh8L uBJyhaCqdqczuyvvvrIi+awhPwGceOXDJNrP+YWyv67MqFtpM6L5rhUV2yPdxOnbhn/q MGZFQEp06/0JKa4qg362Q228Ce0V2T3sdQVL2AS7kvtdHg30QLR7P9plR6qJT8/XBO83 3/Kva2OJIOiSgtTaOqHMSz85suMHzazYw6MBe8YV1Pu+0NZSaXjUf5YdPf13pCci4QZG wLrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mihn/aKPHlaD2O85e+r6TuyfAnA4mSgmIhLj+KW2M0s=; b=LbR8BPi1rNzzJvIsZcLQMYx8CxTyy2MrStv7a7RW0RlAK+hqOgk2aDH510d1/dKMKl 3Q5CIFo9uYf62MKUrP1BSDbdO9gvw1KlWvipScnpXdYqP0IukbfhDJ08iUAXbCwk1OGh lLC4TowHsxSggKXqePMXUDoTsyCQXRdP+eFNmLChYzHo9rNxFh7gCqCujRKuVKR3EwXd 2qU0VGAIjDsVd2u/OuGNA8SjWE+BBWzILVBPqkr1akxWDjAbHzQeHK5jPSxGcNBeYQ1j KbQH2Y0Ydfpg4rAVgo/tVMvYLtsIQNAS24RUl8kAuvcc2owTsxdzEmWQ4HrjTO76U5O5 4QfA== X-Gm-Message-State: APjAAAXhUsqEc63ZuxIAp1s3xlTivIGCFuyXJotLwZ9+vffORwJzHQqR yGrtPlxcJ44uxor7VqiQSx0I4Q== X-Google-Smtp-Source: APXvYqzCYoBPN4HjfozKFyEQU00XlpcXPojNll2yPipzrHj0j/ePOesLnlEZh8WPb/+GnX+KettfgA== X-Received: by 2002:a1c:304:: with SMTP id 4mr6433825wmd.97.1553375806057; Sat, 23 Mar 2019 14:16:46 -0700 (PDT) Received: from localhost.localdomain (cag06-8-78-203-165-84.fbx.proxad.net. [78.203.165.84]) by smtp.gmail.com with ESMTPSA id y66sm8050503wmd.37.2019.03.23.14.16.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 14:16:45 -0700 (PDT) From: Fabien Parent To: matthias.bgg@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com Subject: [PATCH 04/24] soc: mediatek: pwrap: add missing check on rstc Date: Sat, 23 Mar 2019 22:15:52 +0100 Message-Id: <20190323211612.860-5-fparent@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190323211612.860-1-fparent@baylibre.com> References: <20190323211612.860-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190323_141648_217628_5E53AE8A X-CRM114-Status: UNSURE ( 9.55 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, ryder.lee@mediatek.com, linux-watchdog@vger.kernel.org, jjian.zhou@mediatek.com, wenzhen.yu@mediatek.com, stephane.leprovost@mediatek.com, sean.wang@kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, yong.mao@mediatek.com, linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-mediatek@lists.infradead.org, hsin-hsiung.wang@mediatek.com, linux-serial@vger.kernel.org, Fabien Parent , linux-clk@vger.kernel.org, chaotian.jing@mediatek.com, linux-i2c@vger.kernel.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/soc/mediatek/mtk-pmic-wrap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);