[2/4] phy: rockchip: phy-rockchip-typec: Use devm_platform_get_and_ioremap_resource()
Message ID | 20230705090126.26854-2-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1748501vqx; Wed, 5 Jul 2023 02:51:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEnGMrMkOtNnAQRDjIl27a0Op7Gj2ydO9ChQyI8AooIPdlkoaIfZ3xGvF46tLBVXCXmnizn X-Received: by 2002:a05:6870:5490:b0:1b0:4219:6b5b with SMTP id f16-20020a056870549000b001b042196b5bmr15976511oan.40.1688550667138; Wed, 05 Jul 2023 02:51:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688550667; cv=pass; d=google.com; s=arc-20160816; b=tQ1ctvxkFgalwhPLyfcnniG69eCZwwRwkaU3ouc1tRmwyy52OvkDJfObksY2vEyfJv I3zF3smZ++SClgfJalR2R/KqpgozxXB4svtAVHSmyNsJAMx9gq2m4Q12ZMkU0MH2Q6cJ vARQqsdUiUhprtbLpAziGdkwVtCEnJLbjtUJmlteCI5FgFcZWGXdpp+/mS4Pw+6iugLj nMbvKOlA3HArj/1TRwt7VeDduO+aNPv2D8KLUn37SMi/9cxBgSfBuxQ+V/14JzHfKVg7 5bu5UdkbrD7I4QIHw+wrP6p3tEuAswOtbE3JcX9qTN1BQD3rvZr6vhXuU0DBitnfFWch JXtA== 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=b7ZCb6gBF/T5dPOtRZRsisUuFmF+iIQAx5cwFLB54f0=; fh=qRKOll83xUuDb9BHO1WHHyccUA9JCnzwuyhvrMnjSVA=; b=ij6PtJunEGZxeULmH0TQ0AtUGlDUyUKZRIxnjyFcOLhcEmvzC1MANnNYJ8dxTKbXcN e2PijXos9EztmAOyxsxDnnm0EgHdrH751FZ0HZZoZuMRJah4BlUFvU3CmM3prTZcc476 5276AxRnbQpdQy5Ulre1RMuAuyFl5upDMSFr0XV+ukCVxZ+r4SwtDpSjjakJBoIuitpz RWkTtjnOsZULx0E37oZvXEtf7au7Y3toL9dKEpHb3u3a9ls0udWXte10pCd4BB8vU7zg 9mPBkl/74Qa6gluNItYg1M+3QSgsIT6vV49/wYS3QYA8pd5XVLilozlf7DXbciIaTnwm 5NNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=ddoO4X0X; 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 ot17-20020a17090b3b5100b0025bdaaf0d17si1436641pjb.33.2023.07.05.02.50.54; Wed, 05 Jul 2023 02:51:07 -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=ddoO4X0X; 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 S232142AbjGEJBq (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 5 Jul 2023 05:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231267AbjGEJBm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Jul 2023 05:01:42 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2110.outbound.protection.outlook.com [40.107.255.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA98310E2 for <linux-kernel@vger.kernel.org>; Wed, 5 Jul 2023 02:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LDeBMHIOw8e2X8wsB6X0vA2WYYoxewtaL78iZeo9Hot2F/zUbut0xhgPwPPDnm7HgPL3TOt51mX36/FJyLmFIklPnKdzmibDPkwF/4RKdY58t+nKNbOkIvioMvw3MMUVYxFqfKYPnhXzN39J4qkVTLKaOS0f0YYyyzyuPE+7VzjIJvW7xPuy24Ek4ftrorajtK47hWOcREdp+0HRuTyuoVCg5jf3i9UOtnJoo1I8xAMEWHX/PQ4dWcg2OsdH6UukvvI3V0ClUWKRYSbkHTU4u84VPKaUC0qtNZzBekPpSy/EIoCW6Jr7PPlErRg4V43Cs9nUsgUSOdxfu2YX8C3/3A== 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=b7ZCb6gBF/T5dPOtRZRsisUuFmF+iIQAx5cwFLB54f0=; b=MLU341s1/Psi9jOMWEJKUK4d5VMaZF0oowAF1tbKFIybCXviG0Qr+UMwuvkeSrBRiRjowC6z0lI6yAB7u2iHuMxzY4tQ0g9nZ92HRv2EaZH+Ijnr/82up5fVnlRKqHo0O1kGXLHieHCV4Av58uCoq0Y8NImJnDlN8RM6FTuyVgAtf/YdiGkM6BdGMyhHu6RwjC/D87tRWLzwKM/KbJjPtrnTG1Abjxo/H6oS5xhB17/79d4R5WWLrNwfeQm/knkhELvdB8fUWFF8mTgKm/jO3AhpzqGOQGSULaKPwj98OV79ULg8WVDAtjXC6XZC+7CtgB53Gw11L/UgygpUAwKZKA== 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=b7ZCb6gBF/T5dPOtRZRsisUuFmF+iIQAx5cwFLB54f0=; b=ddoO4X0XN2WBsfnLeovQRRMWmrT/uawbONSss5z4SUZMCZX/eJlCb69R6IVaIKlPmJwDVcu51LCbuI2p62TmU/IgiIh7e+7qTi+pYl8jJUQViFmXmrjT0vk4lVqg5icFDHo9bMBqDGSUKv9AFB+vdgqDdh/OzITQY79amfQrxZEtBgaasEmvZfF18RLyaln1buZSFpVyo3lZkJmv5vgqc0IyiBIrrlaFFoM0gdDwP7bwasugHNp2uFeonqxO26CDBJQQ9l58kfivXNxsl93XC7NLt7ypYHcL0HfOcJoBhmW7yohEgD9wippN+o6omy5oPl9/qNS1OIkPtVhqURq+7Q== 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 KL1PR0601MB4354.apcprd06.prod.outlook.com (2603:1096:820:79::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Wed, 5 Jul 2023 09:01:38 +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.6565.016; Wed, 5 Jul 2023 09:01:38 +0000 From: Yangtao Li <frank.li@vivo.com> To: Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@kernel.org>, Heiko Stuebner <heiko@sntech.de> Cc: Yangtao Li <frank.li@vivo.com>, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] phy: rockchip: phy-rockchip-typec: Use devm_platform_get_and_ioremap_resource() Date: Wed, 5 Jul 2023 17:01:24 +0800 Message-Id: <20230705090126.26854-2-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705090126.26854-1-frank.li@vivo.com> References: <20230705090126.26854-1-frank.li@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0031.apcprd02.prod.outlook.com (2603:1096:3:18::19) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR0601MB4354:EE_ X-MS-Office365-Filtering-Correlation-Id: de66c3f9-59af-4460-2953-08db7d367109 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uieH5wjL6o4OqHzGnlCzwOsW47BoZFdclbPQAxdY7g2oHXaoBEww0cgtlLb0egSsym2YrfLVCb6QYZaEB8r5LK/jhLZAKFGucX3U1K7TzT5JazqkC5YnkLfNjgouWyx8Bztloz3uEErrq75LVQno4m9ZoM1hAEtrV2Fqxiyc8tt0eq6NKG8wawfzX7gQzpkajpECF0tE8nj8pnckNMgPhTluxjU5AYdEbThRc2czjblg229t2o+mr1ImIOACok47S1DVMckMswLJiZnS4LGDNoXBCqCxUgq71s6HoizuxYa/Mm85Jp5aPV0jXxC8XeIb2dGJGqJZNCyToKW6+jYMr0JBmDAv//JJdpu59cKsY/0jl/rnlStREAcOVokQ0oevsRpHFmOabyfewiL4M2nqfJY8ieKyzO5ocCHeoBn1lJHngHmspBzy7KOGdY6YlvokJyXyFMpFhh9oTwwTBzUnjSB+yOk93grfDiXmx3eb0cX0xr+LrY1sSBnDDgJWpoAedV/EOU5IaF6+HkMSIsXBJ3UvS7XNn95U51/42ClP0NT0d6O+DK7TRhtE92CDypsaP4wmkxTgZnAQc47h1hGf/Zn+xOxf6dKs/PMcEeBPNfX7lfqQr5Jx55PKTvVgafwF 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)(39860400002)(346002)(376002)(366004)(136003)(396003)(451199021)(26005)(6666004)(478600001)(1076003)(6512007)(6506007)(2616005)(186003)(38100700002)(66556008)(38350700002)(66946007)(4326008)(66476007)(83380400001)(110136005)(6486002)(52116002)(316002)(86362001)(5660300002)(8936002)(8676002)(4744005)(41300700001)(2906002)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 26z7S4EVtT6JYZvikY1yV1Mj15fRuZmQKKxVFt63W2fAYJMQcu0/0rnFHVLkHzzaECOJUhGo9HCw1x1pUJSkyv2p2T+O8Gb/KWokSs95Bh2dKOzLLTgssb/FEAUcXg5Kyv9nAr9gz9EIBSw+bhFacA+Pd951APIinkrEkxTuidf1xlJEZuWEfCd0dsZT+G30pa9KoLL0iTmKvp9CAEYGO8q+1N/JUEbE30JGJCm7dbhCWD039oTujNyE75AVlBrN2PkqHatm+42suIDIxeumP+Rm8LqdWJk3ZMO/g46KjZ8Jthb9Xkt0/AZZ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CNkg0lTbSoy8ncnXC6Sv60kojb52EWGyPu8PwI9QzMVXjl4gCCAQ6pVHEZpUI4uaMMbNwt3DQ9vLSK3wD4bqp7xx7c4Pdq/vqKsLFBJGDsuK6D7Wyl9gVgDFNiUqg+8dot+7sKrPuDuv1L6Q/OqKkL4SSn8iCQn5zS5ofPfz38sV1uAyeKCy62NrdQHGYkw9WKJbm9VF6UDc8u9Qd2vLNEBN X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: de66c3f9-59af-4460-2953-08db7d367109 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 09:01:38.3439 (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: gLewlQxSgw+ojUdirKsO1anosoOMaP0Qi2y5JPlOcUH75r5VhyTd+8lLudUrYeRC6ufAtgk/8CwvuWzJ/iMZ1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB4354 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,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770573704448777400?= X-GMAIL-MSGID: =?utf-8?q?1770573704448777400?= |
Series |
[1/4] phy: marvell: phy-mvebu-cp110-comphy: Use devm_platform_get_and_ioremap_resource()
|
|
Commit Message
李扬韬
July 5, 2023, 9:01 a.m. UTC
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: Yangtao Li <frank.li@vivo.com>
---
drivers/phy/rockchip/phy-rockchip-typec.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Am Mittwoch, 5. Juli 2023, 11:01:24 CEST schrieb Yangtao Li: > 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: Yangtao Li <frank.li@vivo.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Though I guess we should check if the res variable can be removed too. devm_platform_get_and_ioremap_resource() checks for its "res" parameter to be not-NULL. So if nothing in the driver itself is using the actual resource, res could be removed and get replaced by "NULL" when calling devm_platform_get_and_ioremap_resource() Heiko > --- > drivers/phy/rockchip/phy-rockchip-typec.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c > index 8b1667be4915..4efcb78b0ab1 100644 > --- a/drivers/phy/rockchip/phy-rockchip-typec.c > +++ b/drivers/phy/rockchip/phy-rockchip-typec.c > @@ -1116,8 +1116,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) > return -EINVAL; > } > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - tcphy->base = devm_ioremap_resource(dev, res); > + tcphy->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); > if (IS_ERR(tcphy->base)) > return PTR_ERR(tcphy->base); > >
diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c index 8b1667be4915..4efcb78b0ab1 100644 --- a/drivers/phy/rockchip/phy-rockchip-typec.c +++ b/drivers/phy/rockchip/phy-rockchip-typec.c @@ -1116,8 +1116,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) return -EINVAL; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - tcphy->base = devm_ioremap_resource(dev, res); + tcphy->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(tcphy->base)) return PTR_ERR(tcphy->base);