From patchwork Tue Sep 29 10:59:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290824 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2FC1C47423 for ; Tue, 29 Sep 2020 12:29:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 988402145D for ; Tue, 29 Sep 2020 12:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601382542; bh=Ne3dh4tylcpIqw3gc57sWDEHi9qpHguAfHHfpVuiAqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=b6xTvAYn41PZob0fofmwHYTY7daOlGOwpU7hTRMdSNstb5fDqEW5z/hFxzgvlGPxw eZj40CMbkw3Id8OrTan8TkpjS56JnMR3W+S/XvYLuw1BcwIvDyLBelVSkr6oqUt6fS MO35zLR2lMW+XN+MLc+tCBSxd+epvzLZPh9c5+Fg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732833AbgI2M2l (ORCPT ); Tue, 29 Sep 2020 08:28:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:49134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729492AbgI2LcY (ORCPT ); Tue, 29 Sep 2020 07:32:24 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38EDF23B23; Tue, 29 Sep 2020 11:25:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601378731; bh=Ne3dh4tylcpIqw3gc57sWDEHi9qpHguAfHHfpVuiAqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nooGZ2ovJVMrDomUR39P4QxVSPSLQqiAX7yQO8kNscCO5vBuN9OPllw/YY8SvZL3z 5bHPop2K18DKZpAwevju6BDznWCJUR8L3f4nLrF90C+/6N57F4IDLFSL99/iVHAylw FErJM8NcK9sxM4ERxj9x2xLxRNsmws57g4NGDd+A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Geert Uytterhoeven , Daniel Lezcano , Sasha Levin Subject: [PATCH 4.19 119/245] thermal: rcar_thermal: Handle probe error gracefully Date: Tue, 29 Sep 2020 12:59:30 +0200 Message-Id: <20200929105952.777422138@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105946.978650816@linuxfoundation.org> References: <20200929105946.978650816@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Niklas Söderlund [ Upstream commit 39056e8a989ef52486e063e34b4822b341e47b0e ] If the common register memory resource is not available the driver needs to fail gracefully to disable PM. Instead of returning the error directly store it in ret and use the already existing error path. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200310114709.1483860-1-niklas.soderlund+renesas@ragnatech.se Signed-off-by: Sasha Levin --- drivers/thermal/rcar_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 4dc30e7890f6c..140386d7c75a3 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -505,8 +505,10 @@ static int rcar_thermal_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, mres++); common->base = devm_ioremap_resource(dev, res); - if (IS_ERR(common->base)) - return PTR_ERR(common->base); + if (IS_ERR(common->base)) { + ret = PTR_ERR(common->base); + goto error_unregister; + } idle = 0; /* polling delay is not needed */ }