Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp879010pxk; Thu, 17 Sep 2020 20:08:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuYagjzhUWz8Sh7NbdoNt89aRdxSJWliwbK1BS+vexnf1X6T7gH5b6DM0PkrTtUvtvIS9y X-Received: by 2002:a17:906:9941:: with SMTP id zm1mr33229279ejb.288.1600398517085; Thu, 17 Sep 2020 20:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398517; cv=none; d=google.com; s=arc-20160816; b=JS+EYEFooJvNSKGDA0p+z9rfJw5PykMnG2W29zafTTNZauX9OcqBQcXB/60d8ptIyZ 49LiLrNvSJrx8lCPLPUD0UM4od8mEsTU6gQzz83DhtMJTp77zE2DUKjtSc2OCrlfNnnf PahIv0gVuc05uvaxuyO7MC5G1Zq1lplM0VudTDHbIOHY0GztNbc1bQiEPjeqB7kCb8A7 T/eH9MIi7qPU/Ai4n6PNlTJ76dktqUBP/tBonW2vlbCL/Exi0S4gdQCHa0DqBejUwCv6 cbZR30RnwSdurd0G7YPJBZUStEKqlzLfS8PL24KeGmrux3TjmYd9DrQgma3T7d1/Y979 qy2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IUly4SiV4koAHYjfzYQ5rquTjdN0T3wYhY1lMTUiMK0=; b=M9/16JrlrAg+ox3lDc0/m06prG3cJvVSHMWHd5RcTXv9NYHl6p4zcD1KY4thJXVPZ6 LkhEEuswjfFW00mayx4Te+CuzNkHwu1d/IND6X9jKPLwKksZ8WSNCEQG0sEuh6CBHlqL SE3BPEbe912C6qdnxVVZYpLfXIb8QdFdn00i/0J+Iro/JWNyyjhdugfFa9GAR7nyEJzR nTwBdIp1YHGkX2uwzucqtoNOGB2HzHDxrFKsL3SRTiLwpbBZDUAGhRUtq7Pe01781VJZ DcHfOdpefvHeJA/BD551BAQRNtz5kKn0MQL8vLdru+HbgmZMeLiw51Fdu29H9V2QAibI t9WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pXUD0sjR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si1130583edv.189.2020.09.17.20.08.14; Thu, 17 Sep 2020 20:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pXUD0sjR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730567AbgIRDDr (ORCPT + 99 others); Thu, 17 Sep 2020 23:03:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:52780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727392AbgIRCE5 (ORCPT ); Thu, 17 Sep 2020 22:04:57 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0173923718; Fri, 18 Sep 2020 02:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394696; bh=KgF/AJpqk+vmKHHC+vNBhLCqFwnLbqJ92CG2r6+ZfDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pXUD0sjRJU4rnMr2cYMyurEmXIn6XvAxdapxvTkvWRUTldMU8XzI7zSwZ7aZ9HocK IOrOeQ+T9n0WfIHUoSpGm9/cZSS6xx+ViiPGjADv7ysue1M+qf3rfZ0uyzWHa2nM83 /wBjlmzm/rWBI0OwLSbkhaGTttJC83Sau5HlRNRU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Geert Uytterhoeven , Daniel Lezcano , Sasha Levin , linux-pm@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 184/330] thermal: rcar_thermal: Handle probe error gracefully Date: Thu, 17 Sep 2020 21:58:44 -0400 Message-Id: <20200918020110.2063155-184-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 d0873de718da9..43f0cd2bd0ae6 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -526,8 +526,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 */ } -- 2.25.1