netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org,
	Camelia Groza <camelia.groza@nxp.com>,
	linux-kernel@vger.kernel.org (open list),
	Madalin Bucur <madalin.bucur@nxp.com>,
	linux-arm-kernel@lists.infradead.org,
	Sean Anderson <sean.anderson@seco.com>
Subject: [PATCH v4 22/25] net: dpaa: Use mac_dev variable in dpaa_netdev_init
Date: Mon, 25 Jul 2022 11:10:36 -0400	[thread overview]
Message-ID: <20220725151039.2581576-23-sean.anderson@seco.com> (raw)
In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com>

There are several references to mac_dev in dpaa_netdev_init. Make things a
bit more concise by adding a local variable for it.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

Changes in v4:
- Use mac_dev for calling change_addr

 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 0ea29f83d0e4..b0ebf2ff0d00 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -203,6 +203,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
 {
 	struct dpaa_priv *priv = netdev_priv(net_dev);
 	struct device *dev = net_dev->dev.parent;
+	struct mac_device *mac_dev = priv->mac_dev;
 	struct dpaa_percpu_priv *percpu_priv;
 	const u8 *mac_addr;
 	int i, err;
@@ -216,10 +217,10 @@ static int dpaa_netdev_init(struct net_device *net_dev,
 	}
 
 	net_dev->netdev_ops = dpaa_ops;
-	mac_addr = priv->mac_dev->addr;
+	mac_addr = mac_dev->addr;
 
-	net_dev->mem_start = (unsigned long)priv->mac_dev->vaddr;
-	net_dev->mem_end = (unsigned long)priv->mac_dev->vaddr_end;
+	net_dev->mem_start = (unsigned long)mac_dev->vaddr;
+	net_dev->mem_end = (unsigned long)mac_dev->vaddr_end;
 
 	net_dev->min_mtu = ETH_MIN_MTU;
 	net_dev->max_mtu = dpaa_get_max_mtu();
@@ -246,7 +247,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
 		eth_hw_addr_set(net_dev, mac_addr);
 	} else {
 		eth_hw_addr_random(net_dev);
-		err = priv->mac_dev->change_addr(priv->mac_dev->fman_mac,
+		err = mac_dev->change_addr(mac_dev->fman_mac,
 			(const enet_addr_t *)net_dev->dev_addr);
 		if (err) {
 			dev_err(dev, "Failed to set random MAC address\n");
-- 
2.35.1.1320.gc452695387.dirty


  parent reply	other threads:[~2022-07-25 15:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 15:10 [PATCH v4 00/25] net: dpaa: Cleanups in preparation for phylink conversion Sean Anderson
2022-07-25 15:10 ` [PATCH v4 01/25] dt-bindings: net: Convert FMan MAC bindings to yaml Sean Anderson
2022-07-25 15:10 ` [PATCH v4 02/25] net: fman: Convert to SPDX identifiers Sean Anderson
2022-07-25 15:10 ` [PATCH v4 03/25] net: fman: Don't pass comm_mode to enable/disable Sean Anderson
2022-07-25 15:10 ` [PATCH v4 04/25] net: fman: Store en/disable in mac_device instead of mac_priv_s Sean Anderson
2022-07-25 15:10 ` [PATCH v4 05/25] net: fman: dtsec: Always gracefully stop/start Sean Anderson
2022-07-25 15:10 ` [PATCH v4 06/25] net: fman: Get PCS node in per-mac init Sean Anderson
2022-07-25 15:10 ` [PATCH v4 07/25] net: fman: Store initialization function in match data Sean Anderson
2022-07-25 15:10 ` [PATCH v4 08/25] net: fman: Move struct dev to mac_device Sean Anderson
2022-07-25 15:10 ` [PATCH v4 09/25] net: fman: Configure fixed link in memac_initialization Sean Anderson
2022-07-25 15:10 ` [PATCH v4 10/25] net: fman: Export/rename some common functions Sean Anderson
2022-07-25 15:10 ` [PATCH v4 11/25] net: fman: memac: Use params instead of priv for max_speed Sean Anderson
2022-07-25 15:10 ` [PATCH v4 12/25] net: fman: Move initialization to mac-specific files Sean Anderson
2022-07-25 15:10 ` [PATCH v4 13/25] net: fman: Mark mac methods static Sean Anderson
2022-07-25 15:10 ` [PATCH v4 14/25] net: fman: Inline several functions into initialization Sean Anderson
2022-07-25 15:10 ` [PATCH v4 15/25] net: fman: Remove internal_phy_node from params Sean Anderson
2022-07-25 15:10 ` [PATCH v4 16/25] net: fman: Map the base address once Sean Anderson
2022-07-25 15:10 ` [PATCH v4 17/25] net: fman: Pass params directly to mac init Sean Anderson
2022-07-25 15:10 ` [PATCH v4 18/25] net: fman: Use mac_dev for some params Sean Anderson
2022-07-25 15:10 ` [PATCH v4 19/25] net: fman: Specify type of mac_dev for exception_cb Sean Anderson
2022-07-25 15:10 ` [PATCH v4 20/25] net: fman: Clean up error handling Sean Anderson
2022-07-25 15:10 ` [PATCH v4 21/25] net: fman: Change return type of disable to void Sean Anderson
2022-07-25 15:10 ` Sean Anderson [this message]
2022-07-25 15:10 ` [PATCH v4 23/25] soc: fsl: qbman: Add helper for sanity checking cgr ops Sean Anderson
2022-07-25 15:10 ` [PATCH v4 24/25] soc: fsl: qbman: Add CGR update function Sean Anderson
2022-07-25 15:10 ` [PATCH v4 25/25] net: dpaa: Adjust queue depth on rate change Sean Anderson
2022-07-25 20:09 ` [PATCH v4 00/25] net: dpaa: Cleanups in preparation for phylink conversion Jakub Kicinski
2022-07-25 20:15   ` Sean Anderson
2022-07-29 13:05 ` Camelia Alexandra Groza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220725151039.2581576-23-sean.anderson@seco.com \
    --to=sean.anderson@seco.com \
    --cc=camelia.groza@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).