From patchwork Mon Jun 26 12:43:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13292866 X-Patchwork-Delegate: geert@linux-m68k.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A867CC001DC for ; Mon, 26 Jun 2023 12:44:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231299AbjFZMoP (ORCPT ); Mon, 26 Jun 2023 08:44:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbjFZMoK (ORCPT ); Mon, 26 Jun 2023 08:44:10 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2136.outbound.protection.outlook.com [40.107.117.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C5C010C4; Mon, 26 Jun 2023 05:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PtC+yvw7SD5A9waJYhYc8ayxC0CwKLv/Xnat427dBrvfB81vMMRuszHyXL3oZvQQ4Q05HGbLvzWZo6VGCLbt67HpF3xqozLfZBH3pdJe2Y6nDqkrKQqcEAm3OVW7H502EXF44cgKEoTk2OE8rbi4oULxeLe6XwdBbIj4ZFSFfbDCkGDYXozurXPbcNMgvJei6u2zrtNHm0La3WS4uIYH21uBBabZIC+rwaa3kVD/KHz/0bgDkKlt2ZPMpcLRrh2SneYQRBwD+D72vsbfcT7N0kVh0WQTtySW/iTfOh1h+Ocmila/c8Z2FTtZzqhh98pQguKjRhVM1hdEur10QhUsWA== 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=/Q8iWy4Ib3U9fQybucQ9dbTjbgZldNv/RPDvTadx198=; b=VOu+Pin+0pdicaMsomTF7DeXajNc9gbQ25CCFRdEQAPpFpfQ2MtaKo9EcCg1Z+UlegvcRpR/r2gyWVU7MtmVj7R70+kN2XVX6K8Ht0as6i2iEEBrujXkub7uupn9/8qXVAZzjkHeDJRcFQ/LcBaj8I7EGafun/J8NXGf5hUclJec7OlcnI2LwkOYSxUHE+iqgIA/vW0P6YI6PDWE3u8uW3um8pwoi1aos7XvWu5vPATOI1AFEke5r/VLsI1+HYYlGiY5f8wo4ksnXzvN81/SgFjzY9dDdvwHwkRDeLggyglKf5OQY34Z9r4J5PIokPa3DpUiX0vh386pEouZyxZY3A== 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=/Q8iWy4Ib3U9fQybucQ9dbTjbgZldNv/RPDvTadx198=; b=HqaN2b28vO9Fm7EoVIAhEWCOe437bGQE253SVjRgGYf4zMbAK+0LOPyyajSd61ame+kOQWv3Mb01QC5uzIFy1e/C4lWO9e/2dHESpSJME8gjOzlmuCqxLZ4BJXvoPwE08DFmY7DA8El9XwwaRie7PSuFIBsLynnRYq+JUwnmAUUW0+I7mLwPNIFJqm7Z4x+edqZMiPwS7d488GpgCpf4NOOLa7qUSeaTeAtuwSKuTKvFEwbvapTIAB8TxitcTagtBhcvR61VSbzPODQgNmGzwYzhXkZ+1gcKUWTqtwtz1Jgr01KPv2LhmXopEnoJXyHgZ7VrQpym2iZC0vQyeBN9ZQ== 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 SEZPR06MB5320.apcprd06.prod.outlook.com (2603:1096:101:7f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Mon, 26 Jun 2023 12:44:00 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Mon, 26 Jun 2023 12:44:00 +0000 From: Yangtao Li To: =?utf-8?q?Niklas_S=C3=B6derlund?= , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui Cc: Yangtao Li , linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] drivers/thermal/rcar_gen3_thermal: Convert to devm_platform_ioremap_resource() Date: Mon, 26 Jun 2023 20:43:31 +0800 Message-Id: <20230626124334.15100-4-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230626124334.15100-1-frank.li@vivo.com> References: <20230626124334.15100-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEZPR06MB5320:EE_ X-MS-Office365-Filtering-Correlation-Id: 27489156-4d24-4c9e-7328-08db764303d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /bbTi5fW2TdZinTdde+aWlqL+WIafBttX+ShsucPbP+UqRZ7AezNo80sv4ud9jb82z2BhbelVLGSZyFJtCeTdkQqL8z85lhenyYRitWG2CphZJLlzIF9lQplf/0EeXXR+zr7xdcpxJuzkGganFMZd4lPpLbhhrvWsnzgltgOIxFxrS2GIDx/JtyqB87ueNGx2tnAy5w564mN+ZxzWvRdQLViqLY9pq+i37Ny7qZseVzGVSKEAT2bWhPtWS8uxaIysyXHRJGCszq/+OiNPYBR0ObGRhEXRejEqzlTVYl/IetKccLel6b57EXmCnK2axatOse9VaDNQH6IFr97dQUEO1Gr3axqW2JLXsfAXl1gqpeAadB/CaZeKUJ7q3GozDqx+5Y7PWXvD7Co3UrLPcuNbaLxtzqcBdZ2DIFLtm2L89Av8nXIDGeoBdY49DC0ZudRSgk1RPC/MRu4uwLc1PklyH2th21CB75MrsnN5DsJhQAAyZ0d2Wdgd7iWtzLpBx7OuAeTxykJ+9ut8nSpw3O3pVP32YdsVvVTL2iIxX4m1Q7KmxfetTzJNkBHNXYbosmsJbJMYpqW0jy6Q9YJ/PP7zB4dQdsg2dUWJtUx3Xcw+n8oVqz5YYDGbAHpbgCzl4dA 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)(366004)(39860400002)(136003)(346002)(396003)(376002)(451199021)(2906002)(6486002)(52116002)(6666004)(38350700002)(38100700002)(83380400001)(2616005)(6512007)(26005)(186003)(41300700001)(110136005)(86362001)(478600001)(36756003)(66476007)(66556008)(4326008)(66946007)(316002)(6506007)(1076003)(5660300002)(8676002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5tJw2FOGln0Tu2E/BYd1wBy0HCBSBFfWIxoP6aE1fgweFtjJL1/SeRZkfDWNOLRX0pqVk5lqbnAZXsfD9PC0zxHeNXdU0OfyOIGYixyX6X3WOhB67kxoOklOWP/NsMlJ2uc4hCwuRGTtLmAowH8xLKvhZ6ngWe4W0gdcNRytTEdnWwnU8dM5CvBnvEK8mpKErc8H7kfDCeYQSwJTUumIY4Cn53IhsRx8nRifRZzP00bQe/T6hMg9QI4rl3wUsHObYCwtCyYt00Sbmg0APw7W6yd+njqi3iYzbTIy8gciBnELqyr3/LUVJLuHqoWHPx08PV7HAG6oqyDK7OI3jmImA6b1fDrM1WQDAZ4pCPXwxJUIjj7CT/rI+XfZxumvevkUowfLh6znEii/cXvp84XhgnkPdS9UR7WFDsP3O/A6EYHAkPBp8xsruAB4t1tCtuvZz9UDH+uKAWyLDbD9kWepyCgBII3ut9Ai01oc8Efj6aSKSU+29yvl3fpvm4R0eJ00cly+7QfII3LFwl3VRK3HVcfo1tMClePsPIYtxY78VUTjzO0HkUCDsX4Jf5HHKXEopu7OrUFhdLDKUVv5SpmvKX9dRSTw7cXtu4DP/PsWNMYwlZunD9tyzIxuVWvQz1TLf2oPqmpozZM+S9dxB7MYV/G5LstKKP+y9qDkHqhstLaGyGfVTtQGoUVq0Hqr8DPxwy87NL0t/HBtLwFcDeSw8k2/EAfoVlo5AeL1uonqtC8HOtEoK0uzzjzNHSU4IykjApqiWq9xgNTBhR7Z1VSaVsj4v1VJcfvA4CiLZT5zTypkvHMxXSGKWNcyKbrZ9jv7OJASHzl5NOt1uwEJAcJLmmvxRty5y3zLNR4/ETPyUmYhDRGOPTabAkE5a7OEihFYoZ/V6ccu1/lK1paatAVK8MXOeX0Fs/CbIPztPGy7JhS2z/RkDDln954ZIpX/dGIobGD8da4h8kFH3notZ+lI24DOScJd4pPjyTuWneTesT4l63coPdVdc35/bZRiSP+ETos/c0/FQcc4H1hM8jQGcOnKRzWKVpB5nJlsCNbpqF0zoB5MVr3aY9GaSd3//6M3Rq14/xDoTWfnstUJj/0VbC1mTMzFTQQOwiktj/IzEp4XCtaA6vXxHnO2prgtUyZDrG3HoZJgVIl9JLii1Xl59CLaKhnqXGSNw13ZR4bz1LM+PJapexcfrxcMaqJ+ry/ZEbA4zXwnE0W91Na0dUPS4NVUtMu7vXr+2lvWXS+DtBZzJKKjNAIoHcoBzuFQqqcJZhQw2f0m+plkAvsWErcqLtvqnvukzvbaNehGXXtefHaacGyEei8JBD0LjhI1QQ60dZRUvjDu0PPCxcc2q6gOwbtSgZMRiVh64s848ivX29ppOLdvOd1kLEzRiMioyLUdB3Th04hvSlaaXmN2FL1zWSMGLnshdvkiIj3ewreBTisDAUXvUR8M5/8VZobiawhUb5Bw8ohvscqqguxPDn1tTj5pC0xczR2XBiYzKA9ysfwpEkQSoMumj7ZOnUYUd+OEC2uQ0pkwMy13Ejy5iFBYKQYHRQb06aOgEkTMQoaeDUgdqniyF+3Kx85kCzvGQNZ8 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27489156-4d24-4c9e-7328-08db764303d8 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2023 12:44:00.4568 (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: OxfdeJE1sSYix3VZSz9vDMfZvlJk31sWopWFfIK49eDxbIr2YVuij69t/7s27Kn0e4Jn219l+CJ/dfTonCPr0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5320 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li Nacked-by: Niklas Söderlund --- drivers/thermal/rcar_gen3_thermal.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index 9029d01e029b..5c623f13d9ec 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -481,7 +481,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) { struct rcar_gen3_thermal_priv *priv; struct device *dev = &pdev->dev; - struct resource *res; struct thermal_zone_device *zone; unsigned int i; int ret; @@ -504,17 +503,13 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) for (i = 0; i < TSC_MAX_NUM; i++) { struct rcar_gen3_thermal_tsc *tsc; - res = platform_get_resource(pdev, IORESOURCE_MEM, i); - if (!res) - break; - tsc = devm_kzalloc(dev, sizeof(*tsc), GFP_KERNEL); if (!tsc) { ret = -ENOMEM; goto error_unregister; } - tsc->base = devm_ioremap_resource(dev, res); + tsc->base = devm_platform_ioremap_resource(pdev, i); if (IS_ERR(tsc->base)) { ret = PTR_ERR(tsc->base); goto error_unregister; From patchwork Mon Jun 26 12:43:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13292867 X-Patchwork-Delegate: geert@linux-m68k.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D901EB64DA for ; Mon, 26 Jun 2023 12:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231357AbjFZMo3 (ORCPT ); Mon, 26 Jun 2023 08:44:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231285AbjFZMoL (ORCPT ); Mon, 26 Jun 2023 08:44:11 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2098.outbound.protection.outlook.com [40.107.255.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E5010D3; Mon, 26 Jun 2023 05:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l3e+1Ji9lFe/hfVzI/c4ixxWBPLuM6Khfk2ACnzQC7PPU5hR0GBy0whmHxZ4eXNgZAQCoiaSztG76YnvXVWxy34xBRNUoxgoocvryQ6MMYaOlielz+0D4IaDeq8EkmnpbzV9ujsee4eEjPhz3BlwawEX0gmLnsgX/GnlZmB2wlfFeIvRJuz3gdM7Kdfx+7zjDW4xAfKketyFTx/Tp7+gjBRht+vt4EdobtCqt+8nEJhm4AsYp0qEd61NOrW8R91L0uSlJcU+w0WBvKAMgASlUsCnWeO+IynhX5mLcrlMOGt091QGlpnjZtiOQIMAkHmg9L1iNhgOTj5Lj87F4yS0aA== 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=ioGTAIn2Wd+JRgNa5Bg/SoYzMaYuYvU5PSPJ9jcgDrg=; b=RaZCaq3/Sy0liMHCfzx6icwhNjyCNPxm6fn2BVqmbxaQpx/finPU/sdJoWlAalvJe0zf8a6OHuKwRlvC+VPl7l5bwAPj/RFRibNDNX3HVLPHBhBGQfLRY9kOr53Xlp08rYiAZnQQcXoSM3vpbGLRS6NOaT5X8wjvjas/QjS1iTU2OqXaBbXxm4GDsKGTr47TVvjZHP7yIJVuawGeq2P9U41yR8p5lYgz459A4SKNklZ7p7V0DKMxFEEo2SKsZBp0u/v7cPG/W9pNnNz7FtNQ47HCYSuM3RGh2HmpU/LJ7Snp02hwXS6zp3nyQ6Kr2hQ/gYIIG3IUN4apY4HGi4hd/w== 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=ioGTAIn2Wd+JRgNa5Bg/SoYzMaYuYvU5PSPJ9jcgDrg=; b=QZNwaZcP8uonWZXnlsGBfM+PGGK/8aUerVB2tFAN0iVa2XORsM89bOBh82Au1l0ESZSv7iswtBc/ktoNS4VXK0c540bGSw5Z49nKhhh4N3XnDoLmNfJ0ru3RBtqBh212DNXN7W24eHFgKZhCzcm/Y4mr5bd0UONIsQdZXxdWqGh6E+tb7L6A2OCOg+OrH21cgUNyQFDULveEIwBXyshP7sRfI4BI/NPm+0tXG6sIjfFmRLPtGyfrOmiJX+9GjrpS+kq3NXbMfqhs0wRcji4sSaDzVRstb+RIQMoqIisvHnO7Xr5/asTwezrUpx6rCvzbWudSUtPtAP3t/mj75IDRdg== 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 SEZPR06MB5320.apcprd06.prod.outlook.com (2603:1096:101:7f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Mon, 26 Jun 2023 12:44:03 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6521.023; Mon, 26 Jun 2023 12:44:03 +0000 From: Yangtao Li To: =?utf-8?q?Niklas_S=C3=B6derlund?= , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui Cc: Yangtao Li , linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] thermal/drivers/rcar: Convert to devm_platform_ioremap_resource() Date: Mon, 26 Jun 2023 20:43:32 +0800 Message-Id: <20230626124334.15100-5-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230626124334.15100-1-frank.li@vivo.com> References: <20230626124334.15100-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEZPR06MB5320:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e425134-940c-462c-ac3e-08db7643058c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qrTRQYIVOYZCXXqvaHFl86i88pEM6c6nJ4EKjOWgEM/rH6XoOfKn7VpgVoazKRWhR2zrZVylXyVDC5HaNfLOKefOh4mSiEYsNYnUkotX+BALByE7SwlTMn71jOLbLhN1UWS4CMABYbFn9sP9BEdqtTyZQK/32+u82erLl4ealRGbxEY84VNYkKUNvz8+fq9movwISslNd2pqc4n0T007s4OKV+6mpQRh2SH+SBWO4GwPYbqBHgQVDKwC9h2csr2nlYG8dvG8rdniNOx3+nR7ZuToTKi/oGCXy61gJx4xKicF65p9ersJ2YkhbexqfFwCOltDJKtEiiUxfc3YCuNYaFjzpTCHqfvoOlGi/VQ5gE3lKVoddCmm+aQ0gmI6UDc5uzwmQSFEBK5gTxCnNRxK59jmvpUe7uTce1rDTehw8sbHW8w05zS6ET5pzB1/I5sn2ZPMn5mni1I/gRpRT5niwQb+Q91g0qcU2HFGBTDx/P/gdB2WkDILtWTqQspVwhhNTeZKPV6TCzKQwM1pgP33czWNtss8IHQnIedaOKtc/gUPionHSOi7KQU8msmFNkHKKPjCbaTd98QQBn/qSruLNMyHcfM6toXkjW3CS0ZwXf5dnwTJpMVspjE/WaoVxcC2 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)(366004)(39860400002)(136003)(346002)(396003)(376002)(451199021)(2906002)(6486002)(52116002)(6666004)(38350700002)(38100700002)(83380400001)(2616005)(6512007)(26005)(186003)(41300700001)(110136005)(86362001)(478600001)(36756003)(66476007)(66556008)(4326008)(66946007)(316002)(6506007)(1076003)(5660300002)(8676002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VpC42RuVzVjJ5vgfnn2qRetO9rAwQq8GEVKNOSdf3lfQfpISKzZ9h+hN7RZOLbwGBsNg/lu9r+mjtHnbZvg5REh/NMke+yd0pHMCGah2uGUCgzYnT+sktDahnt10dsO3dtN+I4k+yvrLAc0FthwuS0XGrF8S22tyAL7IIQhScSN3GShyTRNRC0RJQm+L+EOH1t73c1tgjRQxcNe1xIaKVOck3iEGA/AZnNiLzN0+8TFoBNPbXolIpbf4RaxoXm0ugr8fmIo8tTIR11gYsy8Ld89T9mDlZF/MF7CdjIq0XnHxsSyC7h2ersCRbB7+NQnfL4jsNaPF0TkPRqjP2OoTxIElVEptS2aIQpAZ/AGRYSQICUsn5vmVVOuLcxWOlcJrhPraSRZdMNmPQKgCs7URkxjBl/VOFhuDDX487lIlBEWlmVMDyhqqhrwwdTfOChzK53iGFLKrPlu2O+N8/x2HdGZ1QgQwwPapskQ/H4FK3DH3hVUYznkvWoqazfvHSNDpi0JnROIOmcwDHICpK25ifjzACHvQo7ebUK4q/F31+eu+C94UBEHMtG4UIm5l3Dy1fqTIEGPbpXAt/BNmizeLkI++E0iK3Op0One28lcz6C7/GsTsJo5K9aoSw1wZ/tPMs98CBByTEcakzVNid6rbJEJMM6fvFcuOCw1NWjPEgxKXLbpnFHIopt7IuAPDWO+v9aE3tRLNPqFDAdsK+EMPvFV36tAYIuZrPTuAj+l5nfpcyfK4vs0om4bAdzp663ltMktTnOKtu33ViKDdO2xsfqh1c1W+ets0GJLsjgUkyMt74SMf69Dqx2mho+JYLHeGIqvP9rbYQkNUjcsFJOpYPG67fr3GhhBOoIZMw1laMo3ue/gfztEBN0jFFJenhrHARygRvVUyVC4TFdc15TTE9nAT9f3V7jur9m7VKrkgdCtJfXkwbCVKKZuGbxys5iL50pQxJq/g6wvbn1HKV9QxHZRv9rd2dI71hEoc/Xp0gr7mUoAiEq7sermDWzC2nKNIYZM8aqdBZkmECgCVJz5ga4TD/u5S0C/tXDXQcXDVNxZJpIe2W9NEnANg/C1MTWIfTQEKASxmSi9nCqHLLCgQRKTnEl9WzWJc8B7iVRra9DCE59vpTMKqxWhODXScM2D8CsiyWuNtY0a8kuC6HKWPotQBml1ONbA+omX70t3W4ob7GsxFDuxNWZ8Adkim1dv12YS4svzKGkZGUsD6bhmJ4D3wXgIvwIKbyOo5LXXL8+WwcOsl/pbCtP1Pq5YT231rg0kH9VgMLRERVGaQvT1JkD6vixtViwSo8EvO+ziDb55IT4IneGg/79Yu+vb9xC4A29yya2MCADNpMjkW2kzIES3gkv4Jy6YX9m3I09fRUbNZEAPmADgMvCEn+ebD2/vRfpIjc5hDAc3uoBr3922XLuMzd2MpFxkbLycRHKXQ59Dd+s8Qqz7EGeR2HOg6viL3ihnWGcfDKqJT7GO3APVb78HBneh0A83OM9t5/DWfKEgRwF0UTacg2verIEtJNBYRj9u4tTvVL8v4gTVLeMFiL6hgTQ5CoGgF1D+RHr6pVDbHEl+iRzwKZk0SJL3YMsVv X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e425134-940c-462c-ac3e-08db7643058c X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2023 12:44:03.2966 (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: a8fCcJDYlmplDdheLD7wVTYPOm66Z1zK0dQxf6fq7DD51NDZeJSy3GKyqdwSavtYNkXrnTl3F0LJFxpWRsEjcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5320 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li Nacked-by: Niklas Söderlund --- drivers/thermal/rcar_thermal.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index b8571f7090aa..04a52d82022c 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -397,7 +397,6 @@ static int rcar_thermal_probe(struct platform_device *pdev) struct rcar_thermal_common *common; struct rcar_thermal_priv *priv; struct device *dev = &pdev->dev; - struct resource *res; const struct rcar_thermal_chip *chip = of_device_get_match_data(dev); int mres = 0; int i; @@ -435,9 +434,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) * Then, driver uses common registers * rcar_has_irq_support() will be enabled */ - res = platform_get_resource(pdev, IORESOURCE_MEM, - mres++); - common->base = devm_ioremap_resource(dev, res); + common->base = devm_platform_ioremap_resource(pdev, mres++); if (IS_ERR(common->base)) { ret = PTR_ERR(common->base); goto error_unregister; @@ -459,17 +456,13 @@ static int rcar_thermal_probe(struct platform_device *pdev) } for (i = 0;; i++) { - res = platform_get_resource(pdev, IORESOURCE_MEM, mres++); - if (!res) - break; - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) { ret = -ENOMEM; goto error_unregister; } - priv->base = devm_ioremap_resource(dev, res); + priv->base = devm_platform_ioremap_resource(pdev, mres++); if (IS_ERR(priv->base)) { ret = PTR_ERR(priv->base); goto error_unregister;