From patchwork Tue Jun 28 22:13:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12899098 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E8AD4C433EF for ; Tue, 28 Jun 2022 22:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XwjnQtW59kmCchKdq6euVEi7dq8SP8eGe6n6AdCWju8=; b=iCRSbpI4phDqHB m6kLds+gtTTB4wfjJn6VBNQRjcaPqDkL1rG/n0fAOpmWi35lNuEC7IRlXMbJ6cnsNVEro0LE/iDhS BG0fgUjbzekr1Xo4AHWo/DE06/cWz+Q6aPiZAEPRxF2VMtKeC5Ce2X8fQ1k0FdLQvWCmKQSZCBh3O 00b+9In3yfV4nL5xPuno4m8bkmIW74sO7ZerRjYQcQDVGspWkVgl58CzoI2tf+PgpXucoA62v72r8 il9/0NWfkNZFbTLxOyrbld0T3OYgc06TF0Ba8/XA8XBZCx+zYkgf7Z39wEvJOc1YcLQstbS0736GV xPN2tIR8aVAEw0hxdK/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6JrD-008TFv-2S; Tue, 28 Jun 2022 22:38:56 +0000 Received: from mail-am5eur02on0608.outbound.protection.outlook.com ([2a01:111:f400:fe07::608] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6JUB-008Mk7-Fw for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 22:15:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=frb07D53+EBGRfY0GSDBcuib2FZm9OnAPOmZe8iu+yK4tnYd0SWI2Hj7/HL14T7IS8/eN5DXtSeolTGbxfBOLgow9PkRTdPQTvNj3iGABtM7XzE7yRMylvOkFKRCUL0DrSi84cloCNl3MRq/aCUjbRsVauozloSFF2xnjMcGfwzGT5slyLYcxhW2zCWh2WEuSjSau+PyVUSwohl66rkO/xZdQzD9gJuzEYnbUgx2Ju8VFLoE0G4JmgTfBSVp42pSkGJp+HUOzkOK8VkaoT1w7aleCpJf4AHCxNsiJpZKJZ8oaEFyuYXZ7JrqQxC3Ljkd/+KlXWXbTq0AhrMTgdnvPQ== 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=PCoTL6T2wxI5vKbrkQY83fq1NJAYMLDQw8Kz5R3A8s8=; b=UqxMpy9KKq3+j78FpxRseRnhlcpvfT8v0cavdmFLYluXpEObaxEKKrFAwDwnDLswi6XB3qNVM4prqpuchnw2q3Hu20hOZn6nYBCK8UV5b1Rb4uywTeAEDW7vGfNOe7IOnELUnaJwhmRi2YN5ljRD6IefG04QoYMB0HSrFqKbqRcqNiIEBsd7yVXRTF2/rwIvMEhT+c1F6Bp8HIh1B4Z46R78+/zVgv5Q12BNq2zUsLX3Cm3xpsH+wTon9ooArVJPG7z6uWJeHSwpNfzg48UW498pfdOInsceQn6FfQK5SuuIvDAYGaGEzeHBjlJ+yUDi1AGhdtpXQ8Ll2qVeA49yRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PCoTL6T2wxI5vKbrkQY83fq1NJAYMLDQw8Kz5R3A8s8=; b=LxFfS0mRJ39In2EpNfu1gbI/RqWzG82/koAaE3Y/ZVmotEsbzDUyMrzDUNJWVWRV6EFu6q/E6IfFcmeEsQOwFJiTFr3Ydz0eKB5mCOQzyULXwOc1kfoZqfPTwwnBnVXoJJXfGI5tfcGe9+GeNcBFc2c2YK2FMu4TC9p7Qlh7Gz0AqM2wBbQ6v9z9rExT/hh62ZMOBL7wOXtwW4GS++uHe284PmCaoiWCFkjNqmGD2+UQ0VRtb12Lqapjp9KAml2OxCz7KnACte+YS+GzvVSZ790CL23ZL73FjGaVyITdFDg9B7iFiOvcqxa3ftKm3ngkAqEgzKiTjLpjTHPYVSOPPg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB6PR03MB3013.eurprd03.prod.outlook.com (2603:10a6:6:3c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Tue, 28 Jun 2022 22:14:56 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1%6]) with mapi id 15.20.5373.018; Tue, 28 Jun 2022 22:14:56 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: Russell King , Paolo Abeni , linux-arm-kernel@lists.infradead.org, Eric Dumazet , linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH net-next v2 24/35] net: fman: Change return type of disable to void Date: Tue, 28 Jun 2022 18:13:53 -0400 Message-Id: <20220628221404.1444200-25-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220628221404.1444200-1-sean.anderson@seco.com> References: <20220628221404.1444200-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P222CA0011.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::16) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 355e24e5-1229-4d0f-ea89-08da5953a231 X-MS-TrafficTypeDiagnostic: DB6PR03MB3013:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3r+xKahC6YhyM30guEmpCHf/tiIlKhZGZ77PSfOwkU4oL29Laj/kE2pHyR4MhtRn8sEs/MlgQaemFCQy+zyafLGGzdrw1tHRDldub+Xa1R3RRPSP0sEDyjTJaZpTcivtYVDF4WtFUm8gO/nPt1zk6jqyj12II308HXJl0Pzz2yEeaSM1LKoSEGfTpK0gmy6OLQy0Jae1JNdHwadNUrePJmKrLFmmWbNCSKYhCINKUOZLorq5mOKH5vfoqw/rFdjli6wphIa+/lCOYIDY1u+GQHIPXPj02VeH1tKd5D6onY/KjKX+sBE/3m0sXq/dElOWy6q1sm4b0L17E9zOAPGbFK1iFvoC65aGovBtLTn/u2eVx9LVpSisraqfl4lZuSb5ITE7Xx5HadZ7G62BvqXliVnYq9Vr204IceY/323kaacgEPhMTKYtUVgMtMkZh19oGDCPr0tWwCUDCj7VIUBL3C6HQ21b5WX2svhiwqrMbqzqEoOou3yA7oxf9Uq8jbMREwKDcLEGM+xjX4OCbRVv+cwMnmhLYrDLCTB4/VK3kwVoZhCbcx3zc2EHKpP1IOtHUV/Jz3fxVKl5Ns2HNORnm+eqlCC19WlRN8rXJzAYD2AxWU5wwIXc1bjsbvwoDZTQrU5C/dIUaK1tNrYsAmprGpX4c0bycdEBONEFyDYbl7tjgoAe2YwyLVmr/82u7mr/MUt+Tue38jZXca35ES2wo2PmP3X0Zgsr8BZ1WdjF6IkmDBxRGyzhDU/DlEkVocKcfGzqn/geMTeAD3p6tvDQFjV20JkPY1SKD+BsK7Op3K0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(39850400004)(376002)(366004)(136003)(346002)(2616005)(41300700001)(26005)(107886003)(1076003)(66946007)(6666004)(8676002)(6506007)(6512007)(52116002)(186003)(38350700002)(83380400001)(44832011)(6486002)(8936002)(66476007)(38100700002)(2906002)(66556008)(86362001)(5660300002)(54906003)(36756003)(110136005)(4326008)(316002)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i/yOAdbZxnXRkUf4SNq4x1bXoJHNu0THAp4WNRfPrdF9XSjfkWSAlLcxa0Ky6lInIjqw1Wsjs6Zm9z9UsmSH0w7PCdt4QD3GJU1FsTBGh3d7cfZsrVrabFKy+phi8AXGYfYWxwWaxLYrg0pgRatieUqaI/a2fIXxHOwTGbjkpS3RdEzMfAp3fCcCdWaDdYz1UMHcDbKmDsUcYf5/wqbNdhcM4F0pV+5S8yz2D3Bic1Enlz372ySBHcvNnGSVwe/WeDyCAQMJZiYCyyU65o+SxDRBKF5SoXpHESQAnCjRc2QoxsNiOuw9gxhSRng5j6azATDAUJjCY7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JaXRyMuzkOz4UbOe5MP0qphhosbrxytBf6qj1+RuCi1V5Yz7/OqUb2jdWS9tdAX13ljX0v/n7+3wpLQ4b+eW18hCNs7rmPXLBsawRic7p+JMVP3/KGSn2Ig78gUio7gzzZqLHmhTxQAZRaWP/qoMxT21zn/lib6RoczHnUg9/OjEvFQTznaROmGVudA0HRYdz0CId0VL4lUMenrN5NVmrFsXbZw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 355e24e5-1229-4d0f-ea89-08da5953a231 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2022 22:14:56.5621 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +BKGATnhskW70ZBKX8D8S7FT5h8On7jJNe98WfE81qA2pzqpb1NrvX4rowqsQZ8PnhLTQnO4KGapSniWWEx45A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR03MB3013 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_151507_634025_6545E923 X-CRM114-Status: GOOD ( 13.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When disabling, there is nothing we can do about errors. In fact, the only error which can occur is misuse of the API. Just warn in the mac driver instead. Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 5 +---- drivers/net/ethernet/freescale/fman/fman_dtsec.c | 7 ++----- drivers/net/ethernet/freescale/fman/fman_memac.c | 8 +++----- drivers/net/ethernet/freescale/fman/fman_tgec.c | 7 ++----- drivers/net/ethernet/freescale/fman/mac.h | 2 +- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index d443d53c4504..0ea29f83d0e4 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -290,10 +290,7 @@ static int dpaa_stop(struct net_device *net_dev) if (mac_dev->phy_dev) phy_stop(mac_dev->phy_dev); - err = mac_dev->disable(mac_dev->fman_mac); - if (err < 0) - netif_err(priv, ifdown, net_dev, "mac_dev->disable() = %d\n", - err); + mac_dev->disable(mac_dev->fman_mac); for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { error = fman_port_disable(mac_dev->port[i]); diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 7acd57424034..f2dd07b714ea 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -871,13 +871,12 @@ static int dtsec_enable(struct fman_mac *dtsec) return 0; } -static int dtsec_disable(struct fman_mac *dtsec) +static void dtsec_disable(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; - if (!is_init_done(dtsec->dtsec_drv_param)) - return -EINVAL; + WARN_ON_ONCE(!is_init_done(dtsec->dtsec_drv_param)); /* Graceful stop - Assert the graceful Rx/Tx stop bit */ graceful_stop(dtsec); @@ -885,8 +884,6 @@ static int dtsec_disable(struct fman_mac *dtsec) tmp = ioread32be(®s->maccfg1); tmp &= ~(MACCFG1_RX_EN | MACCFG1_TX_EN); iowrite32be(tmp, ®s->maccfg1); - - return 0; } static int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 19619af99f9c..8ad93a4c0c21 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -701,19 +701,17 @@ static int memac_enable(struct fman_mac *memac) return 0; } -static int memac_disable(struct fman_mac *memac) +static void memac_disable(struct fman_mac *memac) + { struct memac_regs __iomem *regs = memac->regs; u32 tmp; - if (!is_init_done(memac->memac_drv_param)) - return -EINVAL; + WARN_ON_ONCE(!is_init_done(memac->memac_drv_param)); tmp = ioread32be(®s->command_config); tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN); iowrite32be(tmp, ®s->command_config); - - return 0; } static int memac_set_promiscuous(struct fman_mac *memac, bool new_val) diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 010c0e0b57d7..f4cdf0cf7c32 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -408,19 +408,16 @@ static int tgec_enable(struct fman_mac *tgec) return 0; } -static int tgec_disable(struct fman_mac *tgec) +static void tgec_disable(struct fman_mac *tgec) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; - if (!is_init_done(tgec->cfg)) - return -EINVAL; + WARN_ON_ONCE(!is_init_done(tgec->cfg)); tmp = ioread32be(®s->command_config); tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN); iowrite32be(tmp, ®s->command_config); - - return 0; } static int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val) diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index c5fb4d46210f..a55efcb7998c 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -38,7 +38,7 @@ struct mac_device { bool allmulti; int (*enable)(struct fman_mac *mac_dev); - int (*disable)(struct fman_mac *mac_dev); + void (*disable)(struct fman_mac *mac_dev); void (*adjust_link)(struct mac_device *mac_dev); int (*set_promisc)(struct fman_mac *mac_dev, bool enable); int (*change_addr)(struct fman_mac *mac_dev, const enet_addr_t *enet_addr);