From patchwork Tue Jun 28 22:13:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12899079 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 41299C433EF for ; Tue, 28 Jun 2022 22:23:35 +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=ennwvZ/Grmp8h5TvmeRO3Lz9tSiaijSpVahhkuhIdH4=; b=avG5s4m7qwY4Xa rO1klPhbbOGu/hOciYfTkesxpcs8z1sv1aeK3vAlw8xg9lEkzmaLqwUWSQi79r55ErLfOz2M2uxDx VmUxlDBYkZzwyzWDtUeRgK3u3stISSdKPKxCRkQKxH8S3yPTAqqCEHKuQ9X+8TtwuUf8TYLmPHAZV vTW097w74qIgAgVQL9hZ+E/wwUnhOcFvKycRYmVp6W3viWgNisIpUdLic3BGbq/WxcpijI4m/nwmK DGAZec0ELaijrxvDKpUn16E/dYHqXmaPh3K7FLDPrxCeHSi5Xbie6REAEpAjdNVa3cP+cgUaMSP2B ombxx1b4rWo3uFPk39OQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Jb1-008P3u-7c; Tue, 28 Jun 2022 22:22:12 +0000 Received: from mail-eopbgr80074.outbound.protection.outlook.com ([40.107.8.74] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6JTr-008MXM-Ty for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 22:14:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BH2eshoTsQAkxtw08eE40J5LEZyz+fJfr6vJCJoej2FD1KDVeiFwhxQgyah73l+AGnFTgbapwTpdDJLnhu/dwsd9nOPgL5lDX3/t+gE5WoEj41qHbtOpJDXain6u+h8BtAd1eb0yDaSzoJkIsFrQUxD/p4as+SK20R5XAJq/W1YeWfbzVvJFKJgCLxXfV1dU+c2e3SMawsOo/157t1kxJhieUHu4gShOjNfJQo8y6gPBLgG2rUv4nrPdnbGy3jj5YKpyDaUs5VVl60q3CTOyg4p7wJz7oXHKcRdkodjvJKIBKLunDyQZXLlWu9K/aGOnAn2alAaWZPc6C/Hgl9teCQ== 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=oUrfFcuevg9QB5iLWVeqewSedYp3yYzXMgy6YG9oZBw=; b=W9zdKlkBlbzEIwx6Vf42toLlYTLL4ATF6le4RVOtpk+h/64+GZvsPIZqFWOT+wuRaOkLmzkqXDxkN5IDjV3HvLq7X0vgDRFbk6qfdWdTd+I9I1jhSdCxZfz18E1zY+vcffF290CazvIiGH1EYsKVtmjcWFLkt2GKyWZ32khSxeQyzBceQd4U1zP7rTPmFFreEgFE7uuGEvnpzSeBpEPozGvj4c1U5FUuPZ3uXXxefOLutZZwtuSlIPJ8QzqyHCz4kvyZy0UAXl7Eq7D/EA9ITJ0HkcCDOMRUQsbv3FeHhRD1v2PMx4DEiur2iNxJ7ULlADWazEjnRhYUwYHRbOzmuQ== 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=oUrfFcuevg9QB5iLWVeqewSedYp3yYzXMgy6YG9oZBw=; b=RkAMXvYuGk7fKA0NAM03IhPXgbh2RcrPthlk/ydncHfwBY3tMH8gmkJMG3H/cuWxhdG00acja6963iZJg20rX40hSINBWhIEpRTocDBYQ/EXWVGoM0ZsWau4IpVZMueGGnw4WsSelUGagSKgWSzjJPQL3RdXn0Gpgt1VuzOsQ3lAif5gu5KVgyOTawD9s12LhWCOSJrlUVEBpJYw6yGXE6eMvj1Tr7U2Ir3trQJfeZ/E+EB2h9rvK6ZdrYgw1SWAnM4qLRhC3cLeHPalxvrAI59Xfrwl5/NqtOiGolHxtajm5+dEEjW0LSAPLAP/DS0a/DgFUifeGqfpJ089XaSS0Q== 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 AS8PR03MB7399.eurprd03.prod.outlook.com (2603:10a6:20b:2e2::7) 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:37 +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:37 +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 11/35] net: fman: Move struct dev to mac_device Date: Tue, 28 Jun 2022 18:13:40 -0400 Message-Id: <20220628221404.1444200-12-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: 9c671edc-0677-46db-7e4d-08da595396aa X-MS-TrafficTypeDiagnostic: AS8PR03MB7399:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6x+JpDhGMxPZ2NLd98i2UOSpdFPFtPBdJmC5dKhxmlkRIn1PkBWMftwQ+nit5Ikv87SMsdQbpRy3POM6gJlg+kWHDs5Mr/jrc5uWewlZdb0lGMWZ80AkkzRn/WOZArSFuFUZlJrEDI3ZnI6wt3+2DMsxYcjbpqSHH7BSE6yF8oR8Pws47Thkw1g18xY7IxAQPxZdO9spLRiWgOoZxKrqrl/8/zRytVcqYc36EwwRqE+s9GjOZJ8/SL15pPytfUWOpFrPlFRCtc5UDZC0nrqsYj/nXeP+5bBa8W9lQZR10PQ5fc+vfcWeI+ighSE0XQj+ODOAEdlP76MtDWAhG4RsdYuJUPumF/RcqXnLFkkYGXC4QHCy2TiTiYqIDHvQODuSmu0EVZ8qMA43i2gHoFMD0yTubI42T39si4QMxjZJqE2QwFjd2lC6Ob9pW04VMuHH1NWHidQhmJRGey/nejh/9h0KMhkxYdCoQV/FtHQ1P2CbeXgH54SNGKyN11/uW5vvPQOuiZfcx7nION/t4SNGLRzMlFsOylULpEPtJOR1+7qlT7CRMXnskW4qK7ptnQ8FeK1St+R7LyUj2hxbhVrtDTP83h246FzELTJfniAv9hbqHlQvVKRb/0M+x+Q6qCOfc0sSJ9C8mIZriONduUcVqnZzwBPL5/NdMrSnxZz71BsEJD5l0D1KhT2Ue6xfuciSpqEHJxCN6UP7H+OGODSHOzh2jDhNcChK5k9c1XXvF0i+C6gwKCH+d3y44ZNGYOXELqkYMh/chSoiuTMub9O+15Y1qc8V0wQBZU5IEzBjq1Y= 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)(376002)(136003)(396003)(39850400004)(346002)(366004)(38100700002)(5660300002)(44832011)(6512007)(6666004)(186003)(38350700002)(1076003)(83380400001)(86362001)(2906002)(66476007)(8936002)(6486002)(4326008)(41300700001)(8676002)(26005)(52116002)(36756003)(478600001)(66946007)(2616005)(6506007)(316002)(54906003)(66556008)(107886003)(110136005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mpHJk+8fAu6wELwsTu1DeQrobsJx3l70/tsVgTu0oWPYVMRnMzERETvGgCNAyQcOXKGI2nbhsPwa1BD6DDC9Qg6NqsxT6Yxae2Y+L/6JPAopr6Rtmy9eWKcVHINANVQjc5nFoHBixV/u25kLw0fJ+FWLiNSopO4diunC1TsWEuzqHgC9pdkfSTzoLJrFshfeYfUSrSYBxLUtdcbSJFcIR6dQWbKJJCfydO2ytJ8fOvdxr+CeaKT2/BNVMGYwjXLtTYe5/tN9IpZOvKoY6pesgFSJZC1043IPQZn4HTCc1xLlJurfNpn01XQ8iuVw6p1jOcyjLRrhCGzDOAKHApn3y3trJVKL0xMp4gkY1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0T5H42WVjg0FDNCXz67U6JeT8xXjhqtS0Tk38I334gSUXHz97upjNetRob0nb2wDZ9WHStJfDl6i21qLKxgW00wHaLeVTbfY1oZkIQ8jTqqHo94AWnw6AdMFG8YBDevUcc4ryXYCfBdo2+7AMYosh48YrlgmspOoUy4DqdbIMDU355tSJ5Fg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c671edc-0677-46db-7e4d-08da595396aa 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:37.2822 (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: wXoVaF32tEZ/h2KoPyXTiKAMnV8OTmBWJAiyqr7/JJevCPBFg9JBdOQUZRX/HTdM3o0ZTtTZL6OiH3OtJJm5oQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7399 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_151448_082167_CF93800F X-CRM114-Status: GOOD ( 15.12 ) 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 Move the reference to our device to mac_device. This way, macs can use it in their log messages. Signed-off-by: Sean Anderson --- Changes in v2: - Remove some unused variables drivers/net/ethernet/freescale/fman/mac.c | 31 ++++++++--------------- drivers/net/ethernet/freescale/fman/mac.h | 1 + 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 8dd6a5b12922..5b3a6ea2d0e2 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -28,7 +28,6 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_DESCRIPTION("FSL FMan MAC API based driver"); struct mac_priv_s { - struct device *dev; void __iomem *vaddr; u8 cell_index; struct fman *fman; @@ -47,20 +46,16 @@ struct mac_address { static void mac_exception(void *handle, enum fman_mac_exceptions ex) { - struct mac_device *mac_dev; - struct mac_priv_s *priv; - - mac_dev = handle; - priv = mac_dev->priv; + struct mac_device *mac_dev = handle; if (ex == FM_MAC_EX_10G_RX_FIFO_OVFL) { /* don't flag RX FIFO after the first */ mac_dev->set_exception(mac_dev->fman_mac, FM_MAC_EX_10G_RX_FIFO_OVFL, false); - dev_err(priv->dev, "10G MAC got RX FIFO Error = %x\n", ex); + dev_err(mac_dev->dev, "10G MAC got RX FIFO Error = %x\n", ex); } - dev_dbg(priv->dev, "%s:%s() -> %d\n", KBUILD_BASENAME ".c", + dev_dbg(mac_dev->dev, "%s:%s() -> %d\n", KBUILD_BASENAME ".c", __func__, ex); } @@ -70,7 +65,7 @@ static int set_fman_mac_params(struct mac_device *mac_dev, struct mac_priv_s *priv = mac_dev->priv; params->base_addr = (typeof(params->base_addr)) - devm_ioremap(priv->dev, mac_dev->res->start, + devm_ioremap(mac_dev->dev, mac_dev->res->start, resource_size(mac_dev->res)); if (!params->base_addr) return -ENOMEM; @@ -244,7 +239,7 @@ static void adjust_link_dtsec(struct mac_device *mac_dev) fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); if (err < 0) - dev_err(mac_dev->priv->dev, "fman_set_mac_active_pause() = %d\n", + dev_err(mac_dev->dev, "fman_set_mac_active_pause() = %d\n", err); } @@ -261,7 +256,7 @@ static void adjust_link_memac(struct mac_device *mac_dev) fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); if (err < 0) - dev_err(mac_dev->priv->dev, "fman_set_mac_active_pause() = %d\n", + dev_err(mac_dev->dev, "fman_set_mac_active_pause() = %d\n", err); } @@ -269,11 +264,9 @@ static int tgec_initialization(struct mac_device *mac_dev, struct device_node *mac_node) { int err; - struct mac_priv_s *priv; struct fman_mac_params params; u32 version; - priv = mac_dev->priv; mac_dev->set_promisc = tgec_set_promiscuous; mac_dev->change_addr = tgec_modify_mac_address; mac_dev->add_hash_mac_addr = tgec_add_hash_mac_address; @@ -316,7 +309,7 @@ static int tgec_initialization(struct mac_device *mac_dev, if (err < 0) goto _return_fm_mac_free; - dev_info(priv->dev, "FMan XGEC version: 0x%08x\n", version); + dev_info(mac_dev->dev, "FMan XGEC version: 0x%08x\n", version); goto _return; @@ -331,11 +324,9 @@ static int dtsec_initialization(struct mac_device *mac_dev, struct device_node *mac_node) { int err; - struct mac_priv_s *priv; struct fman_mac_params params; u32 version; - priv = mac_dev->priv; mac_dev->set_promisc = dtsec_set_promiscuous; mac_dev->change_addr = dtsec_modify_mac_address; mac_dev->add_hash_mac_addr = dtsec_add_hash_mac_address; @@ -383,7 +374,7 @@ static int dtsec_initialization(struct mac_device *mac_dev, if (err < 0) goto _return_fm_mac_free; - dev_info(priv->dev, "FMan dTSEC version: 0x%08x\n", version); + dev_info(mac_dev->dev, "FMan dTSEC version: 0x%08x\n", version); goto _return; @@ -446,7 +437,7 @@ static int memac_initialization(struct mac_device *mac_dev, if (err < 0) goto _return_fm_mac_free; - dev_info(priv->dev, "FMan MEMAC\n"); + dev_info(mac_dev->dev, "FMan MEMAC\n"); goto _return; @@ -507,7 +498,7 @@ static struct platform_device *dpaa_eth_add_device(int fman_id, goto no_mem; } - pdev->dev.parent = priv->dev; + pdev->dev.parent = mac_dev->dev; ret = platform_device_add_data(pdev, &data, sizeof(data)); if (ret) @@ -569,7 +560,7 @@ static int mac_probe(struct platform_device *_of_dev) /* Save private information */ mac_dev->priv = priv; - priv->dev = dev; + mac_dev->dev = dev; INIT_LIST_HEAD(&priv->mc_addr_list); diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index fed3835a8473..05dbb8b5a704 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -19,6 +19,7 @@ struct fman_mac; struct mac_priv_s; struct mac_device { + struct device *dev; struct resource *res; u8 addr[ETH_ALEN]; struct fman_port *port[2];