From patchwork Tue Jul 9 12:59:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13727888 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F8B4C3DA41 for ; Tue, 9 Jul 2024 13:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8RWLQls8UMaDFCdMRrldbSCrQAHJtmCuH0F3BM+9gso=; b=tq3XFSkFerubVy9JYacFdhISzY WkDElH3VKoWDMu0bvbLvZHgIJXkk6XmTvA1uhOmDATGoZY6BGz3ZS3WzYLeVsQVi2IE/+B9K3iQU+ ewbhdAfYpYymupAc0H/U8smn06TSsuQxqYT1Ic9ZEjQ5x8/fBnUJih1xxLYrSttRmiq7f8OZKBk5N 9b7Fi2FRHz79Z34Ns8FhqHmzr2kfnKX4k8Q5MaJzF8cpyZP18sp27Ho169+69VhZtT5RwhuxvxoVZ hSfyQv4yTaJDQKNTrYsmhkrEMyGAIY0KPcHpu+SK6ODHHv9ttWuzbeEiae+pGj6NN8qQQLDLm7I4B F7Q5y+5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRAUt-00000007F79-3QIB; Tue, 09 Jul 2024 13:03:07 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRAS5-00000007Dz0-0KxZ for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 13:00:14 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a6265d3ba8fso459913466b.0 for ; Tue, 09 Jul 2024 06:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720530012; x=1721134812; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8RWLQls8UMaDFCdMRrldbSCrQAHJtmCuH0F3BM+9gso=; b=njx9+pyyVUBBgSZoLHc8xuYchyCKaVtwAgOlvgxxxMJBKSn283Dk0Clz6q2ECzxyi/ rpwz+17fZpPvSCarV60RA3y9FLxFq+9qkikLh0o4PwJstZWRcv51obIVMSYGj/k0nkZw 6dWq0KzkrYoiijRFCmnduJpvapeeW7lbKUG7J/TvL0lLh99TATf7i1k/RvrLiFPiBkp6 xzBaBNfGfNcx+2MNFU4c9Wxk1jrqJQXXAtrLmfXGGusEtNTiLrBQ6RTYXsoUv4oKHqrK z3LZsfujkv37QwWqiWKsBZouB4djHHvvAVMm/uctXVmABX8SdufF+aufNUsQXiBxPIAf blXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720530012; x=1721134812; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8RWLQls8UMaDFCdMRrldbSCrQAHJtmCuH0F3BM+9gso=; b=YQvPVJdfD1X3QCAwZLbOc++syzywXDAH8E5DWJmCPmEe14j5KPX8xEf94bJQTbPZ7b le8xAi0VpS9E24dSph0D5qk07Ia8fexJaT1mFAQuyoiFBM4a4/Wm/dzdE0ANx7UTPS+Q /hZHO0nkH23cnkg2Kpfnnrteu0lY9RWYxOG26neMxYBwXQ7MgcsWwV7gTARlu720lPmo wAfOpxu5GSFayPsS4nZpoNZ5YLDimErVsqrQbVulIL2uGwHISUV4NG1Br94wnh5Jk0Ic xshnZJt7BnvXegD35T/CSwgHzjZitSrl+lUAmrVQ6hjWgFRFxXxaU3twAhMLhhdkOp2C 4YmA== X-Forwarded-Encrypted: i=1; AJvYcCVyxYRaMeHojmj/5Avxj+rF5AYkmNim3PDEFZb/wA22WEQfludIHK9f+FM/tvxDS6ToXaL3v9M0c+lsED30KhhEirjMdMNO/nlLP4UgJGINRDHckn0= X-Gm-Message-State: AOJu0Yx/xM1Gb2F5Km4ZDcK4WK0r3i0hWSgJzGXqyDH221H0hYdx7cwp IB3mIOTU9VWD016pmMyJY+KAwjcW9o3uSI/ybBYQQiGHLlyKONuLGkLAWPDlpd4= X-Google-Smtp-Source: AGHT+IFxglRz/Z5T+VfCsX/knJGO7KuIZUuhmH15yka6InP9OkfkQM7bbBSdAh8pScc3pequE2wBPw== X-Received: by 2002:a17:906:6895:b0:a6f:718f:39b6 with SMTP id a640c23a62f3a-a780b6b1818mr140960666b.25.1720530011696; Tue, 09 Jul 2024 06:00:11 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a6e157bsm76643166b.80.2024.07.09.06.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 06:00:11 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 09 Jul 2024 14:59:40 +0200 Subject: [PATCH 10/12] thermal/drivers/qcom-tsens: simplify with dev_err_probe() MIME-Version: 1.0 Message-Id: <20240709-thermal-probe-v1-10-241644e2b6e0@linaro.org> References: <20240709-thermal-probe-v1-0-241644e2b6e0@linaro.org> In-Reply-To: <20240709-thermal-probe-v1-0-241644e2b6e0@linaro.org> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Alim Akhtar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Amit Kucheria , Thara Gopinath Cc: linux-pm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=867; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=5IfasFFY3DfwFwXO+QTo+29xzLGaIOqvgBXD6dEEpag=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmjTREx8HXAlALPSavSuuehlkOZw7wYt7TltXug BcAVDhX8R6JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZo00RAAKCRDBN2bmhouD 1wUmEACGBJgbDwCnSdOFOG0UyK4a/q4rkg3R57Bwxj+JAepNmOkUzQPiVQveWtHqDxBbUYj9zfX vOKb/EKrO0f+MWilnskaKaVfllMwrCAsBOs3lPw7GpwEst8xe3ss+RZrVhS5FI7474zjTAhQ+1J J5tp6vCxsg8fL3GkKDB/DmAHDNojB4kmAjBCkNmmswkzFlGRMRzEjP/8vkziDz69+Dg34UhvVsu jfAAeVOwpXB+4gzioghBrp1lW7nsghBQsc0QXODurL5K7CX4bEVQ7ZEEeOj/2Ug/Z8JnAKhS8h+ h19BaLIC5si+YuZ4D9DNLfo3yiDZOQWoUubij+Dlvn/zXRtzAsaeBfUxwQGzI2EMPuCqotzS9sl 4QDYE3nHKah6mramxKTgnNIr/WXgM79N3qz8k2uTNQVLY2khFESwvrsxSLsRKxUtdI3SmZivv6B axMeFJyKOtY4Hvfup8JWAu1dYeF3KY9rSYC//n8Ho0l+aRbkmQasKC0ZJ7Q6uynJfYYTZUzd3yJ TW6dTT6R+HvfIwlEcRm4iLQmKVfKTVMpvVgpIC6eFf8B1mlBQgU6awT8nGy3H9iF/zScQ1lqjjO UxBnAS+lCWkHcheXC9YiZPskR0Q7VnSezb+0IQFjSY4qb39j1bLd0s/itc7o4hCUJYQTJnpw7it gmMBEdcuKixzSCw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240709_060013_206262_42E772EE X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Error handling in probe() can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index e76e23026dc8..0b4421bf4785 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -1336,11 +1336,9 @@ static int tsens_probe(struct platform_device *pdev) if (priv->ops->calibrate) { ret = priv->ops->calibrate(priv); - if (ret < 0) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "%s: calibration failed\n", __func__); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, "%s: calibration failed\n", + __func__); } ret = tsens_register(priv);