Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp772143ybc; Sat, 16 Nov 2019 08:25:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyIdAAVgsiwyBW7pi7nyHVcSpjs4LF85ubdnK+4J7xXZIU9twPTQybh9dEle+D39h5EyYzN X-Received: by 2002:a17:906:7e08:: with SMTP id e8mr10930717ejr.199.1573921503019; Sat, 16 Nov 2019 08:25:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921503; cv=none; d=google.com; s=arc-20160816; b=SBimqCHmLOBgWMS+v75KcKJPvhNiGxYfzaIEFrI+39notjrrd8MitwjZFQJxsPk5Ld 7T8PbxPwiNA5kykaKAfvP6djUOoazV6urkrdslWH+MeZ474e+EuWZz7AxtMFhAO71RoJ E6jpwgepUjt+tZ8o3JRHTo7TTGiI534YyBroZS0Z4m6Ku/Rcrdt3MK1BMiB8abyKv6Ej rKdG6jbKOkslWnWvxt15rsq5lUrSzM1ejAv0a7e8HVvOM2NstmIbRTCCtXwLKRO9Ojnq 7Gi7wZ98zuQNVIA4pC3gvLJWLj2MKqDf1BrKudYzC923IFEombSM3mirTuS9de57EH2B e9zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4aha3ALmAgR4Y9Al1KFU/YD8Fx+KorBBpoF4m5wRUtI=; b=LjvJqM4o5z/EpEAs0z7b7UFTLnEceYaPfGuQg84D8xDJE7M5kZ8/cn3SZCO2c3OOlp RS6xRCKQ4CHcuomIw0P4DnPy8Dhp0dpVQSImbQMnHyvSlKfhfdFR08nw6k2t3XFIiuX0 0ihYAPqxiyEMhsWjbvjzbIdx7C1jBW5HDrkUfkMInPnKKgjFMmXjE1YrjYkVv1A7+h6L 1mzd8UGXQxvQ0lQwc4eDwMY5HPvS45T+4C2yJlHDJK4QZCx+q4Rqdlp410yiXLCXokdo BL8NXPB6CiKBpvZ9s8KSnB/lGsqVkjvBbJsXOeRn59EA4zHdqYYHvRKPivVzhNVx3dTt C+7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yhgb9Xqn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id l20si8304129ejx.389.2019.11.16.08.24.38; Sat, 16 Nov 2019 08:25:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yhgb9Xqn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1732033AbfKPQWL (ORCPT + 99 others); Sat, 16 Nov 2019 11:22:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:47262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728638AbfKPPnU (ORCPT ); Sat, 16 Nov 2019 10:43:20 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (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 E2C0F2075B; Sat, 16 Nov 2019 15:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919000; bh=TA8Ib/PAXrfuG0ERBmHA7nW7Qdqb2UTASotXuegXicU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yhgb9XqnkZTFenWD4ODvP7D1Ctel3w+mHNL7wtz73MYTq0RR7YiG+t37oBhomn2p1 gLEiyxcpKDMwSWdxdNZxQy+MS33pflGoLmnTS9csYhacM+LsWZhW0fg13Kdg2UQe5L ZhGVNQETU5QTxuZn7ZtcoAm9kG01EUO/CaNK/4x0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , Miquel Raynal , Eduardo Valentin , Sasha Levin , linux-pm@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 103/237] thermal: armada: fix a test in probe() Date: Sat, 16 Nov 2019 10:38:58 -0500 Message-Id: <20191116154113.7417-103-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit d1d2c290b3c04b65fa6132eeebe50a070746d8f6 ] The platform_get_resource() function doesn't return error pointers, it returns NULL on error. Fixes: 3d4e51844a4e ("thermal: armada: convert driver to syscon register accesses") Signed-off-by: Dan Carpenter Reviewed-by: Miquel Raynal Signed-off-by: Eduardo Valentin Signed-off-by: Sasha Levin --- drivers/thermal/armada_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index e16b3cb1808c5..1c9830b2c84da 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev, /* First memory region points towards the status register */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (IS_ERR(res)) - return PTR_ERR(res); + if (!res) + return -EIO; /* * Edit the resource start address and length to map over all the -- 2.20.1