From patchwork Tue Jul 9 12:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13727945 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 D03E7C3DA41 for ; Tue, 9 Jul 2024 13:04:09 +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=fKJKj4ePRCM54jEU3GVYM318cCZM40CyMC5+JEFGxVk=; b=vvGwtSWse6SYv9Lshj5h1YLbUF TSht9d44z2KX0oK/VJGrhENcKgBYFCWQlw5lEG8Zrimfz/SPUvWF2Fg4dzQLO+Lh+FspOk6g+rTyO 0FNO8IxSeurcpQabuSFU/IZIwtMAxFNE3SQqOHSSLH8jzy2s+eu8KKpl9SZyiGPTtnOH4hS/hrdrt F1hMwNezTVwQlpJv3HHuCo0shHMQlIBjfEMx6VyK9MM7ZyeDgLEvA/0n1urzlsxRW/2UZYYOY/Ckl pGNtNaMhXYHwTrEpgbcp6eZialdgLvGK8cCNN9vw/dvtb8U/3OlquJ//gB+CXvXkNMwu2Hj8RLZ0G dp5n+B1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRAVi-00000007FUR-3A72; Tue, 09 Jul 2024 13:03:58 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRAST-00000007E86-1XXE for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 13:00:38 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a7523f0870cso625161866b.3 for ; Tue, 09 Jul 2024 06:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720530036; x=1721134836; 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=fKJKj4ePRCM54jEU3GVYM318cCZM40CyMC5+JEFGxVk=; b=GDKCjAvAWrMXb401zFHMVIRXXGqSEZWGyJvMJEY6D5JuAHpD8BAdDl0GLeMRyqReRV 79NEibPFAzUl+Tn7qJetrSw2hGyMpVOfH+xMKk3kw3ZWi/dWPS5vA7mIRYh86YX/UJlM z2sqXLrlgl/YpSzBzZwX2DAQT5OvqvLuXb8JFFMw3P6wJgrCLq3u9DnZh94b5oOjIhSR am3qkUQ0Rx43Kbtz3YHOM/jX24YsPp0eEb6GSv0hcaw2J2uYQMwbb0Tl44zNoNED9ND/ LWxsXI8JXC0KHkXPTqatxx47DXIStMA7vapLzxdBGlB85ytJK9ND8j2L6VrRxoP2h6+z UW8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720530036; x=1721134836; 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=fKJKj4ePRCM54jEU3GVYM318cCZM40CyMC5+JEFGxVk=; b=Cfnygn3nM2xxLkft6rrwq9vffy9QOH+XZ6pU2qbxX+T8y3fMaBgqMAIzxiBtlCECC0 XpQTMkIjdrFRf9FLn+ncqz6078xu9/iS1QG0LLJ0bELH0rd5Zfsdbf7/Ck/agda0of31 Y52mH25BSh6FoJkn02H+rvarm96XrSpjL8idxJFGB7elkOiVmA09bbcsW3/OQL248+CE opT4FZi6aCT/UKPwGW5a0QGOpM9znAwqhfgomyxEy1ec6rrCngghME/Mc6HK+jgFq8TH lbw15jvyJwX3zEnxe5macbY3iqLWRV1e1EDYFmgSSu9iESB99RSDlgrlYzbOuBa5b+ls y09g== X-Forwarded-Encrypted: i=1; AJvYcCVrRNz964KGWKecFbOxh8ad1Emp2lx1Bp1iYr3kVDQTjxfFu5nWz/bhvdwG6RsUmW1j2cIByG92guL/nN+/QayBywfgqjP2KJvZo3gNFaEhA8C/NvY= X-Gm-Message-State: AOJu0Yxpgzidx7YEdaC4PRiLDCFZVieH939Wza4WqJj30Q4uppcXuH1H yu+hHxU3l+IOV/aN2yjPZ3WiGfN4GFGCoI3pXwwv5ONqkmQSp4PWXA1lUrhaCuA= X-Google-Smtp-Source: AGHT+IFfkk9Ys5H4+GIS3Y5lPnmbtnsV3RBNMXH4S8d48mmpM+eZ7xVV/K5ZmahmLNMktfUV+pQZMg== X-Received: by 2002:a17:906:36d3:b0:a6f:b58f:ae3c with SMTP id a640c23a62f3a-a780b6b1b96mr159741866b.26.1720530036104; Tue, 09 Jul 2024 06:00:36 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 06:00:35 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 09 Jul 2024 14:59:42 +0200 Subject: [PATCH 12/12] thermal/drivers/generic-adc: simplify with dev_err_probe() MIME-Version: 1.0 Message-Id: <20240709-thermal-probe-v1-12-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=1014; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=+k/lazfX5D4DO7g4zI2vHTllaVZsoH4j2XRnMTI6hrs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmjTRG7Kse7IUgMVRX4NLV90g5K2qD30euBH5Pl gWGaMK8maKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZo00RgAKCRDBN2bmhouD 18nEEACI7gxKJvuvASog8vwzRg+a3PvfwZZHrDeguyKmTBJ46V5YCiPTvPJWRVtWUqdAMUfcsAW IhEdMHzSmWOUHTcfTzDHc8O7vvAT8KCZjGFJ43RMUZb3he1BN3Hp06JDNSqEf43CuJg+v+5a545 X5eNDx4RWWWh9zgEO9QzlypsgvXdE4LK4IPu1rs1ChmI8pswR04JWPcfOWCFhLuNGaByjtoPYQs U4lSOh77uqNdYjaSuxJa0xSdFyKJtxO0prRNorCSpZ3gV1xZv2zG82eAQk7TwM0bSgWEq7qg/2A YjlXyoPq9ql12lRZM+95d5OmHGaouY7kK+uWEDUBu+OcEtEizqh2+nieYVSapi1VlfMNRV3n9vq Pzq6vxcnyu4p4GjdKVYkG12RIcI5nLVWkuTA66ZwV5e4OSgs/JpkAok1I5ohrJjx8hL/JesxirT 6KLStUBfXk6SIqMuRSdiPu0hiwweitRaR51TkzYUNaurLAyaOkorxIAoWsJOImpTw9lOp/7Qjbc i5DLWLYegu0qdnia+oFrLWRyZ6bLRZ/lRQgBvq04AViCRNSyKbaDwJ6CiHd1ZKotEHRNIQ+cRj+ h7OhqavBXLHl7a8nYZlx08NNjImhGkT0HKk6NShnr2C+3pQXATuTFyePUpudMTQSEG0jiDqlcDj lMHGtvzQpjie/sw== 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_060037_452216_8FEDF927 X-CRM114-Status: GOOD ( 12.79 ) 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 --- drivers/thermal/thermal-generic-adc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c index d08bff91ac3d..ee3d0aa31406 100644 --- a/drivers/thermal/thermal-generic-adc.c +++ b/drivers/thermal/thermal-generic-adc.c @@ -131,12 +131,8 @@ static int gadc_thermal_probe(struct platform_device *pdev) return -ENOMEM; gti->channel = devm_iio_channel_get(dev, "sensor-channel"); - if (IS_ERR(gti->channel)) { - ret = PTR_ERR(gti->channel); - if (ret != -EPROBE_DEFER) - dev_err(dev, "IIO channel not found: %d\n", ret); - return ret; - } + if (IS_ERR(gti->channel)) + return dev_err_probe(dev, PTR_ERR(gti->channel), "IIO channel not found\n"); ret = gadc_thermal_read_linear_lookup_table(dev, gti); if (ret < 0)