From patchwork Wed Jan 18 08:44:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 45117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2233208wrn; Wed, 18 Jan 2023 01:29:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXtIwwI/0WaSZSCoUayTo7XbRGT3DZILwfnbJdTljOeF6f79TvfpKmnIHY8p9qg2uFHmiol8 X-Received: by 2002:a17:90a:674b:b0:226:c917:85c6 with SMTP id c11-20020a17090a674b00b00226c91785c6mr6412784pjm.2.1674034140274; Wed, 18 Jan 2023 01:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674034140; cv=none; d=google.com; s=arc-20160816; b=MUE9RRyUDS2m8M6M9ZWHkqsWjZIhWCcBHFrLvz1epnOyHoIAujeJO5CC0nnjijML/7 a9xLf5DcPUZi1KBeLfqvG6DH1dP4lx9M+5i+PKvCLT6ycSGdT0mx6VseL0qukoiJjWxJ 0Ql3Sw2bTGQKGIvY1YLuWkD78ZkYBp1A929/FwgRe94Ma5ZZwkbRuf7zF509VMZh5tus QAS5udC+LcB4NZSremIL8bDJvCUNFtM9ECDOtHbipikfDs8qMvs8bLNcVlqAy+i1+wVX mJliHmEKFFGYE5pLmTneNKA/B0vhUQi1mdgqjYxsDX7N1o8tiPdIEfoJomO+vhKzSqcJ U6ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=cfEUyOwydyR0Z0/KuOKXac/L5WS2fsnsDBiiOhPnbfI=; b=Uj6sJwi0v6bHyY6glz7eUypcdaVAfZ5kdLlPykY+vbOTgD8ObWYhTjVklDBNfFVrq1 AjTTeK6cqobBvtZy+wXvkvx5F0MYGdouhpQ6UGu4S9oeIJzhfR4x4asLQCSGe+bZgGYs YQuROw9udL++fjnmH/J4GnbiF9Z3cOeQmaC3iomSAdqjxrZO8lO/e8XVw3RCsJdar76v vMFtjkhPiodyxF1GFeD4GT+Frz7V7S8CmNDHgX5NHMJG4njlkie0XfxabPu10rsl93C1 5PjGSv/LwdXll8zofLmG/UZy20uCUXLILdYqJK4usfNQ7dhr5RV0O5PC33iKx/UPPO/2 TAvQ== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a17090a8a0300b0022949f5ca1esi1620430pjn.86.2023.01.18.01.28.48; Wed, 18 Jan 2023 01:29:00 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbjARJ1J (ORCPT + 99 others); Wed, 18 Jan 2023 04:27:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230165AbjARJVP (ORCPT ); Wed, 18 Jan 2023 04:21:15 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0396D5D13F; Wed, 18 Jan 2023 00:44:51 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NxfTF45mSz8RTZG; Wed, 18 Jan 2023 16:44:49 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 30I8ifLt073519; Wed, 18 Jan 2023 16:44:41 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Wed, 18 Jan 2023 16:44:43 +0800 (CST) Date: Wed, 18 Jan 2023 16:44:43 +0800 (CST) X-Zmail-TransId: 2af963c7b17bffffffffa2a1cd29 X-Mailer: Zmail v1.0 Message-ID: <202301181644433003839@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?utf-8?q?=5BPATCH=5D_thermal=3A_spear=3A_Use_devm=5Fplatform=5Fget?= =?utf-8?q?=5Fand=5Fioremap=5Fresource=28=29?= X-MAIL: mse-fl2.zte.com.cn 30I8ifLt073519 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 63C7B181.000 by FangMail milter! X-FangMail-Envelope: 1674031489/4NxfTF45mSz8RTZG/63C7B181.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C7B181.000/4NxfTF45mSz8RTZG X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,T_SPF_PERMERROR,UNPARSEABLE_RELAY 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755352022565812439?= X-GMAIL-MSGID: =?utf-8?q?1755352022565812439?= From: ye xingchen Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen --- drivers/thermal/spear_thermal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index ee33ed692e4f..6a722b10d738 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -91,7 +91,6 @@ static int spear_thermal_probe(struct platform_device *pdev) struct thermal_zone_device *spear_thermal = NULL; struct spear_thermal_dev *stdev; struct device_node *np = pdev->dev.of_node; - struct resource *res; int ret = 0, val; if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) { @@ -104,8 +103,7 @@ static int spear_thermal_probe(struct platform_device *pdev) return -ENOMEM; /* Enable thermal sensor */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - stdev->thermal_base = devm_ioremap_resource(&pdev->dev, res); + stdev->thermal_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(stdev->thermal_base)) return PTR_ERR(stdev->thermal_base);