From patchwork Tue Jul 9 12:59:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 811526 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E952E1662F6 for ; Tue, 9 Jul 2024 13:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720530006; cv=none; b=syF2Gw+dGkGMcb3kSNU6B8+ehjapr4gWMqnpOtzHuEgxWB4vuRJppLLhptxzN/jLzDTGL4+wVo47U/VJbMigQ/V5obGeIrhahv1cAHx79byHXSIXBOx4OyOiOros+10HQB1qwHo4SOTWE4HhL6XmttP3TciqI/ynTGEtg6QfyPw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720530006; c=relaxed/simple; bh=uAMTrcC0mVom85qx7RgLzbVpmGNoowEa4jhQ0iR1o5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LEmdDAkmPxuPaOfkhvTxnjF0xBuktIBfM2udM5mZZ09JbVPGmWes+wKZ/QGW4V0Dj41I65fTNsFuC3nRxI3ZEyaLEchzftMcC7B8UF76gD7176RiDqrxzOlWtp23G4WmxyYESSxfk6bAd2/u95lznI+92kujHAzYFtaSidcwaWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZkzMVutB; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZkzMVutB" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a77c9c5d68bso483861666b.2 for ; Tue, 09 Jul 2024 06:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720530003; x=1721134803; darn=vger.kernel.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=ybUy1HdKJy0SC3jBHxTxEhNlXRYkfN8Lxd1LqP4XqS8=; b=ZkzMVutBjjYqq5Fe1r6tIXaVmNDF/1uirhsYHQNYPdl4C0zeBl2brP7qVphXOKz2UZ MK36gOmsusZ3qyyyfm7nvPSZZa7GBFXMjY+kuxssOc0BY3D1zdrEY3Xj9jUYGa5rSSWO hgHNYKA2Slx9rDmhUN4LShWghMy20+J7UTKGVVb9d+EPXN5Lv1M/wLIV/mhlq2IniYQK aYbHJRsW7ZlCwirBjhbwxcX4KYNL3az0GVSXgl4u1n2VcsgO3hCosZ6P662F/P/RKo9g dktiqbB9tY+inbO/THRndSJdjIxjJgN6juKMZMSvjpHykScfbH1ynDtnMeNPtwsk/RUR 7rbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720530003; x=1721134803; 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=ybUy1HdKJy0SC3jBHxTxEhNlXRYkfN8Lxd1LqP4XqS8=; b=hTGD3Rb7uZwYE8+wEw0ulRauPnfWaB+8JR1ZbLK9PHgUoLWIjVZ4MjDgDaGoJe4x7v boZPvKfxobJeizgLUdSoe77vTILbADOXSM5cm57j7nyQLFaptfjfi0Zm7dLPZBUptndY D58SxIJU4Sr4WNUeePsnl8cjTHpOm+KpQc8bftDo0SfDf3ihJIvjMKQLD5liYVOZhDLo Z+LzBQ8OcAnUhTAfCPq1EEkESGvYX+oyqiXXH+GZKwOzCtvFdRq7RqlQ2GXVxaYEZA0T dkAwT5oQdQvhT10amLLxdmNMB4hMOmLNlfaBHasLvZuA/on2Ij5vrL9Hvcj56EyRlLnb WTNw== X-Forwarded-Encrypted: i=1; AJvYcCWqd9rVTKM8ClvUu+nMu2628l3PVgvSObSO+jKlWtoG1hMawOBHJnz+/dhZkLbHlDn2HP56MGdVZTkt7/Xj5LPtI4Xe06NF6t+qRX6l/A== X-Gm-Message-State: AOJu0YwR6HUAvo7Mlom+H1EFY4vrp7ka3OABmtJQfhs/LoJ2Z4gkYUAP L8MVTzwLRDyilCpH/zdkD+JZ9vJolDNHC9rVGCJeRzUp9+Qa5h6G9bN2CBRU/k4= X-Google-Smtp-Source: AGHT+IEyRyFqkTwfhXvnWJMCl1GxNNv1QnYMVp0FnPJnRyxHf5vBWrGeQmH6Alt/59F10w37lZmLdg== X-Received: by 2002:a17:906:e246:b0:a6e:fb9b:6769 with SMTP id a640c23a62f3a-a780b89ed2dmr142387766b.75.1720530003303; Tue, 09 Jul 2024 06:00:03 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 06:00:02 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 09 Jul 2024 14:59:35 +0200 Subject: [PATCH 05/12] thermal/drivers/exynos: simplify with dev_err_probe() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240709-thermal-probe-v1-5-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=2154; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=uAMTrcC0mVom85qx7RgLzbVpmGNoowEa4jhQ0iR1o5U=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmjTRAedXAsDTOKwPCKtVeeBDQKl2GzAwF+mcHe Zf9U59jtBCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZo00QAAKCRDBN2bmhouD 18itD/9VymA98RLj+xi7Rq9XMA4oXDVEu1ExLXuCaztzc4IZ5DS+lAXwA60GwTRyHSg12gpxodX wGTxdIsXm4HQC6MocbLKhr2jRUFWF5mhHytUE4GUUvT3J4F8fc73MSKOfMa/Le2ZZtj2uvOWBK0 nKj10iZWWvmTqZTX/bn9itKX3HfshX45Y9TLwc2XuczRzqCelbhxTpqZ9N4vI2XdNOQ13wHXq7A LGO2+oDYGzzp4+2ilbIJWIQI598b0kyEqWyYaPtMWlOUVBZRBhOvAG0XnSaJjR0MWXBoNsO+JjJ q4EeU+DKyl/CQnkVw3p8pZrunC3T3EaDD8IknOUF2ZiJyuD37ahtQQvv7clKHWzWiQcAgCGazqp 3X7JYISIOiq8eYnguL6kSLvstAD8KPb14mlScjX/J/vq74Cxp61tA8oPJl0ZwiUzpfGxuQvBTAs 2vQV6Zv/GDJLqwG+vPPrFjVzCId3rhmIfdJCCkHZKopeHQmi/220/XRfXg4UYRvtpado0ozAEaa RBywtVfSWiQMs9txTHYbqQXEz73r3/K/wVi1+mHB6IE4ImufypcbAQLpgM7aqn3HZtprwamb2vZ RMBUeMTZ63ZOlIdRXRwjTG0SULdlI2iKGH2LOTd6JbxVw1wcsy3SS+FrtgP6uKkfxBb1NR0EnIf qywB8pGu0hH/zaQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Error handling in probe() can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski --- drivers/thermal/samsung/exynos_tmu.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 1152871cc982..96cffb2c44ba 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1037,17 +1037,14 @@ static int exynos_tmu_probe(struct platform_device *pdev) return ret; data->clk = devm_clk_get(dev, "tmu_apbif"); - if (IS_ERR(data->clk)) { - dev_err(dev, "Failed to get clock\n"); - return PTR_ERR(data->clk); - } + if (IS_ERR(data->clk)) + return dev_err_probe(dev, PTR_ERR(data->clk), "Failed to get clock\n"); data->clk_sec = devm_clk_get(dev, "tmu_triminfo_apbif"); if (IS_ERR(data->clk_sec)) { - if (data->soc == SOC_ARCH_EXYNOS5420_TRIMINFO) { - dev_err(dev, "Failed to get triminfo clock\n"); - return PTR_ERR(data->clk_sec); - } + if (data->soc == SOC_ARCH_EXYNOS5420_TRIMINFO) + return dev_err_probe(dev, PTR_ERR(data->clk_sec), + "Failed to get triminfo clock\n"); } else { ret = clk_prepare(data->clk_sec); if (ret) { @@ -1067,8 +1064,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) case SOC_ARCH_EXYNOS7: data->sclk = devm_clk_get(dev, "tmu_sclk"); if (IS_ERR(data->sclk)) { - dev_err(dev, "Failed to get sclk\n"); - ret = PTR_ERR(data->sclk); + ret = dev_err_probe(dev, PTR_ERR(data->sclk), "Failed to get sclk\n"); goto err_clk; } else { ret = clk_prepare_enable(data->sclk); @@ -1091,9 +1087,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) data->tzd = devm_thermal_of_zone_register(dev, 0, data, &exynos_sensor_ops); if (IS_ERR(data->tzd)) { - ret = PTR_ERR(data->tzd); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to register sensor: %d\n", ret); + ret = dev_err_probe(dev, PTR_ERR(data->tzd), "Failed to register sensor\n"); goto err_sclk; }