From patchwork Thu Jul 6 12:08:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 116663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2525365vqx; Thu, 6 Jul 2023 05:33:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlEhPBCsofelDz2MWvmvd7dVw+2jg4FDJ74wUvvzHb8isuG3io4iU4eJoP+3Cx+8GGSKfJ5U X-Received: by 2002:a17:90a:f2d1:b0:263:4685:f9a5 with SMTP id gt17-20020a17090af2d100b002634685f9a5mr1193675pjb.8.1688646832201; Thu, 06 Jul 2023 05:33:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688646832; cv=pass; d=google.com; s=arc-20160816; b=sbxBz1CkaAUOu29QMWK84SQGxXLGHOqSOTToj6h/LbNvQNoocT8cLs/21XUpCXU0eT 4gnYUTZLH/LtNpGPYzlNemyjHVpjNqCZv702IQb6whnvwm0pQB3XD7dl2r5l9o0U4hr0 e3fyeAVj41fd/kcdp+I2L+jmEkyt5SfnrjG2GBbCk6myWDYXAEU93e1ZO8Z4MYPQWRyA IeF+cfp99+lk3rXo2rPBoGxWn2r6XLdqGan0pwueuV8ZWhq0RfLTGea10KcbtkDkaUJi CZ+Q3Pjp/VI2iZDkkvpwxNWv/NnY3xAp++Focs0ACCJeYYJmI1UB0VrBOdIQagxFPoAB qn/Q== 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=CYK0gWsmtg565K4lS9dtcMG4ncAikY/JtazCy2/f1rU=; fh=JxBGot9+rHFWo3OLvF15NYTNyFN7I1qxqEpaTsCxKjI=; b=ICx/IMIS54ecBYyvsOMSOdNOU0SV9VfEGl2+I8U1T/AR+HfM/66u6lPBuIiMqe/t4l JrDqrqGVKcVsbnF0N8N1tebSuTL5f1SRQ08/NamGfTLEDaT5qq+om0HiR3AUBUWBofm0 UX+0sdqxS4+K7LjYMShTmV3BuDFrlc7NVDgmbaXEeN6lwpfIngkfIRcCqBbVehKqAQtj 7VBU15LMRpISZdjr8F4n9S9jMlmEwyLM7f/zSX1kr+DHRExn2/V2lm67d+hW7HJZ7P4P yCXsr0OF/+cVJ3CJrS8GUH+7KU5fPNznUi+fMaXe+/IIWVHdv3/0o+qA/P7bWt9gKT/2 kQeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Kbm3cTKY; 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 w2-20020a17090aaf8200b0026319a0a04asi3591226pjq.171.2023.07.06.05.33.39; Thu, 06 Jul 2023 05:33:52 -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=Kbm3cTKY; 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 S229509AbjGFMJR (ORCPT + 99 others); Thu, 6 Jul 2023 08:09:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232713AbjGFMJM (ORCPT ); Thu, 6 Jul 2023 08:09:12 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2107.outbound.protection.outlook.com [40.107.215.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7237B19A0; Thu, 6 Jul 2023 05:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S01MHSq8s8RU5jy8X0Aucdahm/e50vmvrKiaoTq0u/qAqq8sblbGOj7GOU4D6UiZFZSALqcqCMs0NGCG/MUQ8TdJ8HuoP7oJAoMyKuiPL26lJAE+wKVWyaKu/mGtGJJUW8bk2pD4bEIvkKk5vuMpj/x0ztp2N5Lk30BRVpGfgTOgqVOe9HUzr5TKdYuGYO4otCh3DIBu4b08IgpcYioarXWjgkapRtlpRxWHHkyu/febIRUUZwikFZNDpkHN+AwJPo+ZXljw3R+mPdJ1qCHT+jdrJxoeyAKM4BFFJUOLmieMA684aEJyL5IWcfaDcuIzL0/39h5u4Yj16slVTmFibA== 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=CYK0gWsmtg565K4lS9dtcMG4ncAikY/JtazCy2/f1rU=; b=nKCFYqprL96OUx/dAykuJcO3Z5YmTgPCllhcJa/XlKdsqDXDZmMWbj8QNO9oSAFf1EQ6F0EdTBn6hzrLeePc0iBVlsE0C7LTmA/LHu+myh/+xTXqIzZsXzE28o0DibNTQGm+15KyDPWzf6QC3tkFXLfbafwdSVbhG68BiA+Pv3+q7CxVZcINGZFtEIFi6pfinu66n1BNWPLPHSC6qK7ZMomKphi6w6qAQuKiovJfD72WkcIwxwbxWxVG+XQvJfDiMXe9rQCSYgD0Lvz7g1RyirW0ho3Dt9ERfdQJfvSdHjnMpoKiIuex+ogDRsEN7rkTDxAn06KgDsqAWB/n+DgPTg== 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=CYK0gWsmtg565K4lS9dtcMG4ncAikY/JtazCy2/f1rU=; b=Kbm3cTKYMEEYpaZk6wKMNJRja82hJVXx/CjiVbhtKV/FolRhtMnqj9K9ZDUSUZLvJNCY5xQBFh2Ac/qhCjQQ9e2Hvihi13JtuaDivn87XJ5+769KMAcyspw8Ka19eq5WmwmvPMmOZ093iOKg4TvFTyxgTpuUhX8d8HKiNkl9mQMBOp0a11kTya3CTRqBhApM5dZbdqHDcWykTE30CGzbdBSl6KLiZ1jQacDW4/WYMqFFzw2YYP15DUR3sFELXCIvAlYcmGFME2d2cLxHysMCpKwg2asliE0Uc8hA2pj7q3iCTpC7ZGqbUTXgaiVA8Ls8FPEYXkN7ubvtKfzBocIvBw== 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 TY0PR06MB5634.apcprd06.prod.outlook.com (2603:1096:400:278::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul 2023 12:09:07 +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; Thu, 6 Jul 2023 12:09:07 +0000 From: Yangtao Li To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Yangtao Li , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] net: ethernet: broadcom: Convert to devm_platform_ioremap_resource() Date: Thu, 6 Jul 2023 20:08:50 +0800 Message-Id: <20230706120850.11026-4-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230706120850.11026-1-frank.li@vivo.com> References: <20230706120850.11026-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR04CA0004.apcprd04.prod.outlook.com (2603:1096:4:197::22) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5634:EE_ X-MS-Office365-Filtering-Correlation-Id: befcd9bc-7106-4868-5546-08db7e19cc50 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1TPU7ynRUIz/fpMHptuvDX3mmZPvihlruo1HL30AXkuuANcnA5r+RNIaqGIgmZYPW/dq2cRLqQBK4fR3CVs8osUv6MxEJLXw3xpIS6oaxJBC5QIwiKnGPWxsRv3Zpu+dLA7DKUXU6Sf6Dre4YK31vbc0uuwWS0fxV0U9Q0A5D2EaKkuTwkEvGyBI5Is6mnX4kHxOrwJVljXGwH4hQuknVmSpAmgH0NbtOPrddFKarMSlqJlVpEvKYif+CiioA6Pqvuk7aQKyYDoi5TjCzu7JHMQZsK3DxjvC4zSMyo3b0Y5yYREaEI8IvdwBs0AaZFqcsL22s04YLdTnCAsXiwLQBOfMkkz/9A+Fv7GJqZQK9/+qguPnvCCyvYlth5pK4Zft8x+bs5RDlJNEjUSxOlb/n0AbGjgA45JheZQMBggpJTTDHsbff0zRoMS3xKca4WZcSdMev2TEYqB3A8TEHtIVdKii+QG6ShEktzVSz+ujMzIEExxrv2JyvOMzyl/8ktQuBnNGnPkBnXSWi3WARn+8QeDosyqtO0hU1aiHuNh0qI+JyPbU1G6p7dp+V0I2gKJG4LmTEMXAnYkJCn6lKOAoDWDf1blUGjvAbLNMN1nK1pDr0CJQ+cM/kNPjzlDgclZW 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)(366004)(376002)(346002)(136003)(396003)(451199021)(6486002)(52116002)(478600001)(6666004)(110136005)(83380400001)(86362001)(2616005)(36756003)(2906002)(66946007)(6506007)(1076003)(26005)(6512007)(186003)(38350700002)(38100700002)(8676002)(316002)(66476007)(66556008)(4326008)(41300700001)(8936002)(5660300002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: f8NMqAueIIIt6LE4wGGaCohlRWwGqtyyRFISlxaHhvw99XvtrCcp+5ZZuIYuBXokwaRcJCB7wFWmmYjrbCYUxBGq1Zwlbn/aKqqaW7iB32Ufh305uEgFdJK92P0HApd5liq6UM3by9lmQgh43Xh/nt51qi7BbuVGGbde5KQLnwLMXOOXkN62Hb+RyUYFdkknnjYqBwOsQcu5en3yz721wQeOMMI9DhmRKhAdzSSUDv/HFeLs7kdvf4U2E9FHEhExsTZKZQCak4Vr8Oq9QkdHsOrmRSmbPOoj8hHzAJCNYw+6WDg8azBaVZHouhJw9oedf9ypl35Zzqt6QZ/VOQmmw7rq7lREZ/SsQ+0GAHgLteFBrJ3ULeyCYb7F40rmaLWGx+fRfJozX0jHFwxBny18KzTrBUuHJlN5pXhkDsPfXjp8wD/LzNeecbvnJXvv3wf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BFTrK22z1A1f0JjXwBWXR/jBCMCfUqYLirll13bvHaEhplqt7aP2o+tRH0MIqZbEaFQDUnvY X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: befcd9bc-7106-4868-5546-08db7e19cc50 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 12:09:07.1460 (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: 2qH3u63wBOexqLDt/E9kLWLIddetmVCCD0eidV+uTsMKYR2awAHw1hyDErFmRjnCqMKtOw+meaIro2fvL6Obnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5634 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 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?1770674540894040103?= X-GMAIL-MSGID: =?utf-8?q?1770674540894040103?= Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 2cf96892e565..e6b28077449b 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -2648,17 +2648,18 @@ static int bcm_enetsw_probe(struct platform_device *pdev) struct bcm_enet_priv *priv; struct net_device *dev; struct bcm63xx_enetsw_platform_data *pd; - struct resource *res_mem; int ret, irq_rx, irq_tx; if (!bcm_enet_shared_base[0]) return -EPROBE_DEFER; - res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); irq_rx = platform_get_irq(pdev, 0); + if (irq_rx < 0) + return irq_rx; + irq_tx = platform_get_irq(pdev, 1); - if (!res_mem || irq_rx < 0) - return -ENODEV; + if (irq_tx < 0) + return irq_tx; dev = alloc_etherdev(sizeof(*priv)); if (!dev) @@ -2690,7 +2691,7 @@ static int bcm_enetsw_probe(struct platform_device *pdev) if (ret) goto out; - priv->base = devm_ioremap_resource(&pdev->dev, res_mem); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) { ret = PTR_ERR(priv->base); goto out;