[1/9] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs()
Message ID | 20230318144412.75046-1-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp320880wrt; Sat, 18 Mar 2023 07:46:33 -0700 (PDT) X-Google-Smtp-Source: AK7set9Q/+0tnJE/02f0/NznnL7JTI+vrnL7jH/wU7PsP1bmkxju1QNLNo1vpqs6Ijl3O0CWnp8y X-Received: by 2002:a62:6345:0:b0:627:ec37:1e69 with SMTP id x66-20020a626345000000b00627ec371e69mr460069pfb.8.1679150793526; Sat, 18 Mar 2023 07:46:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679150793; cv=pass; d=google.com; s=arc-20160816; b=pMhygjmfWB+5g3lAAvgs31Jz134A1u5/hhkiPnO4x9eGXcROT/KKZttAvDntFyFf4M JryzL6Y6yCigRsbyWOIW8SyBYeFzNjMk0UWEGvrStW8QtxpwxJjoTHitxOfPxguVPR2b pPyRpVGE9wCeRPiMaaIddCLLLQY43XHtImJPI5P3JlhiSy3RwQiAoUXpZqaAGLqkoYig 8ZGQPSp3nZhWgdZw0PB3wNG8fIJXENOx5zcWk8JULk6m64BtlMHtuWyxzRBvPrIn6AFK xwzrE9/XSMS76lxvu+L8bRrZK9XRT9feS/S0qpE8NnGYiUVE3mIJDY5rwndnVIlGr9CJ Xvmw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=g+NlqBmxA2Og63Ol9FtrEG4L5yzQxZAUCyz9v4IE/T8=; b=Hx0Qsh2FvYnYaL7c/QHPGuaMwfjA7grnTI/gGCG0o4MSqgBlMsyfh3DPmPB/orNcEE u8Pm3Si9GHxW0BubmtM4uY6hH9aFK16q+VS5xr+PlZezwEBAODs+Di0RJoKqjagLN3fU aoXKBU9CKzztn9+vM3icc1mJUUvIclXcKjPvyVz1onzY+S++oKvZgUMEQ1jk7JY1nOlZ VeYBvzt32miDIn9z3+1cO8BmY1BecROwVuM/LoE0BiVZvYuZQHm41IR8M9XZncEATRei k4Mk8Ys07bfbFDWEB97ATEydDG1eOiOvncwj5V84odg+Zdpv8p57IvYV99r/c2P6DgRm sdwA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=h6fzTLp2; 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 p19-20020a056a000b5300b0058b9025bd61si5653152pfo.53.2023.03.18.07.46.17; Sat, 18 Mar 2023 07:46:33 -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=h6fzTLp2; 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 S229541AbjCROor (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Sat, 18 Mar 2023 10:44:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbjCROoo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 18 Mar 2023 10:44:44 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2135.outbound.protection.outlook.com [40.107.117.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 443685266; Sat, 18 Mar 2023 07:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mzZ5X5HCXsWVOPhAuFzSN1UwD8jJZ8RLIfnAa1ggxH5+k54MksDWjELvwVEPkPEfNJSyu/j51Sm8LXZVbXElsjODI62dZ39rz4rKzASwuXJs5p08XZBy8dqNsK4fZUfYjqJ3X/7DVYwmAXgGjn7YH2kglU5nHzSHiuUO3mfL0iotGUH7tVoSdxwcdlzdaVR/gQHtNQz2G1puCk0GaEOcs3/DkYzTGx7MkIfGyDcAvldNyyUiYgYSLfenPqd6Oi3Os4bukO5GjABykVN09k5M8DS8amT+0XAn0lIBLiptlSTwBSfQc8IQAT7VCZGMbASs7vEBjcv3uTLduL2QVkTFsA== 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=g+NlqBmxA2Og63Ol9FtrEG4L5yzQxZAUCyz9v4IE/T8=; b=HH7JLXwPyvHgyvjysnVfjh7mx7K6oxOc/Y+Cb+mHLxAic6mJpz2kLZqyNoaGwzSKI3f4QKv/h29zDTIAFRBzRjK+uScjQIbV3Cs3tbZW5Gb+ZXC4qZeXVAb/3KiT+IMhCnk1ILWYXgFPxKJafssuICCPJuhpGMLZmLf25A8J7YEOxB1C+MJhE9XZYR2+zNiX2QZgkR4z9Fs7uZ8nS4A4H3clVxFMFu1B4Ehi+HPNQ3Qk4bYCnSmyug8CybM8Kx6lG0Am5I6UJ/Nn/hGTl12vsCScw5wfWycq887bBrxtH8QJVidTowba/5CAf8gBEYF1bZRcnJAHCx1aoT+NCUQdZA== 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=g+NlqBmxA2Og63Ol9FtrEG4L5yzQxZAUCyz9v4IE/T8=; b=h6fzTLp2udDZTlPvUPq2p2Po6M4G0VCWzfha8c04oefpEI48Ga/N1MIWeQviF5UAdL154WtSYSCO4jWfGgDA5yl/eZISE23NjowepoU7d1xgAKohLB08uaGQRyG6ShlKquPXNBEBLFmgRCcn1OWImws8p9MRa9Lpk2uqsRQ+F6+iNKcGcjZ1lEjO8dLDhjfno2gYndUR3Fd4DSJg9ldTKtDZwgYccJwErJhLs3oGTCnTnsyTCidegDH8fho4Dd0yS0HKZqy8jG//yojIFRsgKwK3HiqXG4SGdIE5Ix0oW/CQfOX0pmHJxCix2g1wAhNNAQSYZZwF/X/+zEUI4HEBeA== 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 TY0PR06MB5283.apcprd06.prod.outlook.com (2603:1096:400:210::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.36; Sat, 18 Mar 2023 14:44:35 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.036; Sat, 18 Mar 2023 14:44:35 +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>, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/9] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Date: Sat, 18 Mar 2023 22:44:04 +0800 Message-Id: <20230318144412.75046-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0032.apcprd02.prod.outlook.com (2603:1096:4:195::12) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5283:EE_ X-MS-Office365-Filtering-Correlation-Id: e8c128b2-e4f6-4ff1-a026-08db27bf4af5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t3UaLwJACAcC4JNZYxz8UHvaA47GfR2Snl57Moq92aVGaxrjB/XSe95G/yRY+SqySFGmEaGj+oakMqbmm/oQ1OXK7r55LSV2USw2TEHV6bjfnROjKG02z4ng68ZsQvWvXzdT9fJNK/ZIfaGF3hP3HlTd05WnM0zZyX6MbeJpQAHki5svPyqHiLzrou9KBwjeCunAdQEEbLRIcPY4UiCrDQMyph0COD46qcsB9/XWvdhFnjtK22lVdwtP1yA4ZAXGi+BrIDiQXz30GxYzcGYSy+QiLoIEcwE7ZV+kzC4z0Yod0vk1wlQwfXBLYu9iNl2upQZiyeje7W0N/2TG1tqiucfNgXBzuJWzkKp2DUcfR6LRDOdV0ssIO1QV6DRasEwiEuol/9CHczef97iX47fK3TbklrHdfiBbhyW6DicgLu9YYMPHqlOwdEjNedmv3LvKtdo75KE6Du/SeDiXGOXhy5MZx+NWoCKADOn8N29/8HJ7ijRM62GdmeTaYXxcnmMNiNm5KHv/Fw6vQURCINzcqjQoqWNFXe7n+LgGc1QRTBlVhcn9wDQ3I2N5UcVHz/vLtdqVAM0z24W3iE+sKqG0vphoCm0ht9dQ0huqj3jNbpUzhNEhbZAFfL/szOxkNW86BLtlQ8T0YOadwk/MIrabIBms8u0NOjq+zPsxQvlzGaBpVz5wxeAsEw0emotOgHbV 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:(13230025)(4636009)(39860400002)(376002)(366004)(346002)(136003)(396003)(451199018)(86362001)(36756003)(52116002)(316002)(66946007)(66556008)(66476007)(8676002)(4326008)(83380400001)(478600001)(110136005)(186003)(6512007)(6506007)(1076003)(26005)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(41300700001)(2906002)(5660300002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xx0csyT05QBAYQlt94arwS/NSxUH5JWAXjIhQ+e80HhoQ3waqf3Y8qLH8NZLMQTXbWXprOIR+7QaPrDXN4Qnv1b+aLO7h4+pu8qjhxuc2f4uKM9Dx5Uo40ZUGtvTPVMxi+RGkFYYd4vbutYT30jSuaatyA7tnx2POuTfpUfARL564QOSjpsoO2gTBQcRM+8qwcEtYbx0QRJeI4NXVPV3XAI84H5B+qvOUDrKGmsOxdti+Npuurya0Dx7TtzvsqO7sFKPmZLgFS9S/5rev9RJpOG6dNdlVStqhyJohXFItZfx7sEsFVpzfwjtvr3bBTjbzR+4mhjyuG/3YZNHeZOZK3DwKLqYvNyUZgZ5lz97flIlCUVGYiM5RY992lNUJAYY0sv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YpkxXBj9hoGoXfE2MPwRmRA1xze/IZ2D14WrkxeUuzPnnKuGJOyC9LqzHl5oIy3Xp3lefRzxzveSvkU2+OrdAOa6ForL26RBAKHXsPimgBMUp9BkxENo77bVbvD0SB9oKPR7Incb6pw X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8c128b2-e4f6-4ff1-a026-08db27bf4af5 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2023 14:44:35.5573 (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: N62YFwcwJejKkuKHP2912b4WJVCmJ/iYNHlrEfjcYS9AsWCfIhm0aZt/inQoPvCxmRx2ZtARoMApq2VFMLV2bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5283 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_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760717222229670539?= X-GMAIL-MSGID: =?utf-8?q?1760717222229670539?= |
Series |
[1/9] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs()
|
|
Commit Message
李扬韬
March 18, 2023, 2:44 p.m. UTC
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.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/thermal_hwmon.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index c59db17dddd6..ae87401b1a1d 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c @@ -271,11 +271,15 @@ int devm_thermal_add_hwmon_sysfs(struct device *dev, struct thermal_zone_device ptr = devres_alloc(devm_thermal_hwmon_release, sizeof(*ptr), GFP_KERNEL); - if (!ptr) + if (!ptr) { + dev_err(dev, "Failed to allocate device resource data\n"); return -ENOMEM; + } ret = thermal_add_hwmon_sysfs(tz); if (ret) { + dev_err(dev, "Failed to add hwmon sysfs attributes\n"); + devres_free(ptr); return ret; }