Message ID | 20230721094641.77189-12-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp97848vqg; Fri, 21 Jul 2023 03:09:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlGA6ZpWMyMvCpHxhrLEaOWKeB1B5liHDBxeiSSapBuhDkUmB+9yIhJk8lkG9o6h3Sq4fXbn X-Received: by 2002:a17:90a:6342:b0:263:e814:5d0f with SMTP id v2-20020a17090a634200b00263e8145d0fmr1186069pjs.41.1689934187565; Fri, 21 Jul 2023 03:09:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689934187; cv=pass; d=google.com; s=arc-20160816; b=U2InpxQfA8Mc//gihNzkcdP3NBo2Sni4o3O+u0DdwA6pY0zjMI/qhABC4Q2HXDSOfz 9D18vCAN8ctXv4Yk7DaChAXXrIn6rp6w0MHd9uNiTFGFW3D6xnHC2JnnLv9Llqp/ClgH BpDO4FjaOG9WxlYkwc9LN0K98kNy68PcsDB+8zU/gHAOWHnDqSYElV/p7ln42ql2gl6y /tCljRZ/6tKyJrAON8/N2vUtR8kDJIhqtaxqKYIWFQ9Z+fNvxA6FaJ2+JVfoNxULO/Um ephZVnnZ5CBm/BD282sqSO0LHy+ut3PDrLksQ6ah4aVflDKw0k9UQU07qCF8yesvzCND om3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Q2g69HSmEHuTTYKyKe+Ic9ejjUzfByis+TpAlcnSq4U=; fh=KTv2T1r/QNJZkf7UmS3j/ysaXQ+6ICZoxyH0IbK8Eew=; b=Uv6Ks9NZnpMK3qNjhT4fX+oxx+Qm0ZHwLfDCnZiNYHrkYMvYWHESt0oSAYgLrU0Ght 88N51qlVyyl6LfVC1jiDKlDDDYJ7qRdn/XdrVSi9FQHbLRSm1ncAK+ntWGr+gSnYHHHj rBToKukF5lX4jRv6uPjtjbLDCwKaA2PxTrGRDPzKXp/b90OE3bkEeVp1kdWvvYwDsQ/k 5IibNI/EID/4sqG/OjHc8DOywLdVkGNbh/CVpUodeeYgTgd5aQwb797l2pQn0ZsoTn6S P0DJCbcTJyRMT3GBB0WuaEGiRqak6uqXjwpcWJd77Udklhjd5CoUJtcS7eZOrwBie1aV VOxw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=YTb6enSV; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o8-20020a17090a55c800b00263a923c189si2906273pjm.100.2023.07.21.03.09.34; Fri, 21 Jul 2023 03:09:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=YTb6enSV; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231915AbjGUJtW (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Fri, 21 Jul 2023 05:49:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231908AbjGUJsh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Jul 2023 05:48:37 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2095.outbound.protection.outlook.com [40.107.215.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D0B12D7F; Fri, 21 Jul 2023 02:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAlvYNOHbLRWL8dkY+rxaIkaylhb9PZ+z2o+5wurx8Hv7qgyZ85exdWLRFYlJlBMzSfo2CRljWRJcPPtcM01/0k5ooGQWZYgWrFmuDseiS0yqgzE+tGh638cC+rkHteO34r/CW6FDO4IcyyJpxvXgBEmRdAxNEUyWtAB+Ahe+BXuslLs73VVIKA3n9rUtovnWTqk2nNu2Gws9KVRvbf+Fjv46MXg2kNKzt3eAej1tjWGsnvsF2dEqvaJ1Wp1V67CVvMu6FWwrY5rDWc2Kd8Vc52ADSjAG6ipgqd0cqN4CEi+5MsHIYP+dxNI9kyT05Vx2YzP3iZLGHw3KLMLJ5AjEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q2g69HSmEHuTTYKyKe+Ic9ejjUzfByis+TpAlcnSq4U=; b=kZsKGoO4Q4fhuhAEoJzNR/2PMJROpaBDPllmeHrVDKB7xnrlKInRj+o/BPemzKtYrenwnQORgKjTXPG3hcCpoJ+Al7GVxUVgvLTbIATSpfGY1WbK6/kVxhblsppKUN+oV+52V8BCo1dx/rLqT30J2Gy3si18eSUqhuP6pu6K+Kt383VFHz3ycJ04MYta8Wx9EPyrtkr2CZbuXkp7pBWMdYtK43uExFSXcZp9NTsau+eqU9c3KOHYsTbhbL5ZdMuew0OdubRuJORfAqMYpvT4pmTckcUXHCNIe9R8ivLjLrMhLAFemju2Kv/4pj4Kz5b3RINS5pZ1P4Ry3j39u87Cpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q2g69HSmEHuTTYKyKe+Ic9ejjUzfByis+TpAlcnSq4U=; b=YTb6enSVBUaz+anOhpMDaLr+55YqGeXHhuNnCgZ2ki7Db5AOVri/B1zUuBWny/HyRQPFqFnYbM79fzC9cF9FZb0b/z8txIv15AxN4FBXPulcrUYSmTtOBuWXwOrTA2JLImVEGFphBOt5/Pd+btTouoVeV1lVvF6/ngjZTOz51wW3IrH3ETqZwa1ByOa8QurqZoGwVp4//h/q+hb8ZQdXJ1ludefNzqC2lj172wZexfsIwrlkM6FgKBqtpR4qqYlj027rxYbGC8sV3UNzLRRrW4ElVe8dVWospzAFXKrVrFQnTC29BOzAihTVxv/k6kJZDIuluA/8CKVUW6y3o4ydvw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by KL1PR06MB6789.apcprd06.prod.outlook.com (2603:1096:820:ff::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 09:47:25 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::732f:ea1d:45a1:1e0b]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::732f:ea1d:45a1:1e0b%3]) with mapi id 15.20.6588.031; Fri, 21 Jul 2023 09:47:25 +0000 From: Yangtao Li <frank.li@vivo.com> To: "Rafael J. Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com> Cc: Yangtao Li <frank.li@vivo.com>, Thomas Gleixner <tglx@linutronix.de>, Krzysztof Kozlowski <krzk@kernel.org>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Jonathan Cameron <Jonathan.Cameron@Huawei.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 12/22] thermal/drivers/hisi: convert to use devm_request*_irq_probe() Date: Fri, 21 Jul 2023 17:46:31 +0800 Message-Id: <20230721094641.77189-12-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230721094641.77189-1-frank.li@vivo.com> References: <20230721094641.77189-1-frank.li@vivo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR01CA0031.apcprd01.prod.exchangelabs.com (2603:1096:4:192::11) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR06MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: cb0de5b1-2c60-4176-d00b-08db89cf7cce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A94iBdEAKMIA9jAfumInEJw6Gxgt23CRzdQ8Cenkvwd/do5Y1Y9LG98albR70c0NFvKxNZ4ugQ8pHXnmm7lxEMhxur/8wOjZdNe1VmjAaquXlOmOm1JrlxM/u/YwMI5jt6zv6o2f66D5AHFnQn2efP4WJM3cVyidgdjrEwAl2sc/FqwrsUYc7E/g2swqku2YUbafxxrNA+3s8TLkFgImFBfDJuqEYh7N7nwgDs/b7tuOj98Gpv6OF5BxHg6V9CkfInG3+OmYQVOKdL9YJpiWvBHloz+cs6lPGh2eQ0MOFbtxQkUaAEClR9K89qh8pez6UW9axK+Y5n2fojjKCdKFX80jJZEVgK2FKInQneqdPHZzdPBl+SSLLKmFIIcD4/SztxX8wCkDokm29EZu1CtFoQrScwArYSz4Uyo4tb4fR+M4bk2LskLhxnBkYQ8M9BOluWKOemiiLVZjNpOcX9Qy8ExBBj+O/XNgtY967FWPZDQUK5xs37sV9p0LhDn9r8eGYN7GWEJXR3UyiYxuaAmj/V1J0tDQOHoOhBEVnxuTkK82G1zFk9s89KqnDgabH2Owevb2ffvdpA/SHZmybtMa6JebAsAhpT6/t4uz2syaOIvFD7TZNw4qrhibjRtRLo5T X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(346002)(376002)(366004)(39860400002)(451199021)(83380400001)(66574015)(2616005)(2906002)(38350700002)(38100700002)(66556008)(316002)(66946007)(478600001)(6486002)(41300700001)(4326008)(6506007)(26005)(186003)(1076003)(66476007)(52116002)(6512007)(110136005)(54906003)(36756003)(5660300002)(8936002)(8676002)(86362001)(6666004)(7416002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?pGKIrrhK+MC+k/RXR4YyS7KDDxYY?= =?utf-8?q?TnmfgF624DFw1fDl45gHEF2InPoQf8WWH8i9WXF2zlUDxGemxjakILE1UZnLVN2+6?= =?utf-8?q?hEtFqYOfccvQplakcIDN9jA+hH87XJbQx10u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2GO99tQI+fTpHIlo?= =?utf-8?q?ySd4vuWVSbwpQC17HVRhYYzAaNKCdRy+ZgWOiVpfQFZFfbvgb252cxQtmJUOINA8E?= =?utf-8?q?RfIu8X+Z0bctCrOrF3h5Jznc0U+2rogDNfMfZSdsv5ezoUcdshcZgd+4CUwkJTqgt?= =?utf-8?q?aqSWuZ462wIC0B2iBgs9S4Bxrk9BAxKU/n/r3mLoX8/Y2XgrUpoYl7joUHbaDLZf6?= =?utf-8?q?8HyXOPZNT4qILuGxas50siKLJJxQXy83p8t3J5GqdMvG4NlLia/TfUSSDLDhZU/d9?= =?utf-8?q?dmqNfn9xj+yxR4THMRwdg158T2jvHDcLH05+ThFnNx95kAyh3nWeYCJQvoJAVwidn?= =?utf-8?q?E4iqWq0pmoAUXBcXzbUqPWCZudkWgrGCDnF4+1A0NoUodgpw5CyVbviNRNWr1IWAi?= =?utf-8?q?//LDu8ltUAO8zLXM8a3d0JJWcPQDQrl0tj6pJ6cOEVWu9itOwzxsMfcM8Y3bTvq9H?= =?utf-8?q?3Zt3dxfHf3y4o65HCXCabvK5QvfLs/BqQ8MTwi8LUG8CxnKjQnEbpO8plqJx9szzg?= =?utf-8?q?ISLrcqNlt3gT?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb0de5b1-2c60-4176-d00b-08db89cf7cce X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 09:47:24.9605 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: z7S/F4KsXjcZwEmXyB3eJXKExHfOhS+U8UsY7mMnYWZqkejnM8pEXBTfvZGUJTFBwspFpOjjBIu9xhIs05xw1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6789 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772024431099975850 X-GMAIL-MSGID: 1772024431099975850 |
Series |
[v5,01/22] genirq/devres: Add devm_request_threaded_irq_probe() and devm_request_irq_probe()
|
|
Commit Message
李扬韬
July 21, 2023, 9:46 a.m. UTC
There are more than 700 calls to devm_request_threaded_irq method and
more than 1000 calls to devm_request_irq method. Most drivers only
request one interrupt resource, and these error messages are basically
the same. If error messages are printed everywhere, more than 2000 lines
of code can be saved by removing the msg in the driver.
And tglx point out that:
If we actually look at the call sites of
devm_request_threaded_irq() then the vast majority of them print more or
less lousy error messages. A quick grep/sed/awk/sort/uniq revealed
519 messages total (there are probably more)
352 unique messages
323 unique messages after lower casing
Those 323 are mostly just variants of the same patterns with
slight modifications in formatting and information provided.
186 of these messages do not deliver any useful information,
e.g. "no irq", "
The most useful one of all is: "could request wakeup irq: %d"
So there is certainly an argument to be made that this particular
function should print a well formatted and informative error message.
It's not a general allocator like kmalloc(). It's specialized and in the
vast majority of cases failing to request the interrupt causes the
device probe to fail. So having proper and consistent information why
the device cannot be used _is_ useful.
So convert to use devm_request*_irq_probe() API, which ensure that all
error handling branches print error information.
In this way, when this function fails, the upper-layer functions can
directly return an error code without missing debugging information.
Otherwise, the error message will be printed redundantly or missing.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/hisi_thermal.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index 3f09ef8be41a..ee5f50fb2b68 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -576,14 +576,12 @@ static int hisi_thermal_probe(struct platform_device *pdev) if (ret < 0) return ret; - ret = devm_request_threaded_irq(dev, ret, NULL, - hisi_thermal_alarm_irq_thread, - IRQF_ONESHOT, sensor->irq_name, - sensor); - if (ret < 0) { - dev_err(dev, "Failed to request alarm irq: %d\n", ret); + ret = devm_request_threaded_irq_probe(dev, ret, NULL, + hisi_thermal_alarm_irq_thread, + IRQF_ONESHOT, sensor->irq_name, + sensor, "alarm"); + if (ret < 0) return ret; - } ret = data->ops->enable_sensor(sensor); if (ret) {