From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/4] net: designware: eqos: replace double accounting of interface up status
Date: Tue, 9 Aug 2022 08:24:21 +0200 [thread overview]
Message-ID: <20220809062422.1749563-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20220809062422.1749563-1-a.fatoum@pengutronix.de>
Network core already keeps track of whether ethernet interface is up, so
no need to replicate holding this state.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/net/designware_eqos.c | 11 -----------
drivers/net/designware_eqos.h | 1 -
drivers/net/designware_tegra186.c | 2 +-
3 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
index 6b372e427492..79b997969755 100644
--- a/drivers/net/designware_eqos.c
+++ b/drivers/net/designware_eqos.c
@@ -623,10 +623,6 @@ static int eqos_start(struct eth_device *edev)
last_rx_desc = (ulong)&eqos->rx_descs[(EQOS_DESCRIPTORS_RX - 1)];
writel(last_rx_desc, &eqos->dma_regs->ch0_rxdesc_tail_pointer);
- barrier();
-
- eqos->started = true;
-
return 0;
}
@@ -635,13 +631,6 @@ static void eqos_stop(struct eth_device *edev)
struct eqos *eqos = edev->priv;
int i;
- if (!eqos->started)
- return;
-
- eqos->started = false;
-
- barrier();
-
/* Disable TX DMA */
clrbits_le32(&eqos->dma_regs->ch0_tx_control,
EQOS_DMA_CH0_TX_CONTROL_ST);
diff --git a/drivers/net/designware_eqos.h b/drivers/net/designware_eqos.h
index be7bead09e0e..69c6ac193f57 100644
--- a/drivers/net/designware_eqos.h
+++ b/drivers/net/designware_eqos.h
@@ -60,7 +60,6 @@ struct eqos {
const struct eqos_ops *ops;
void *priv;
- bool started;
};
struct device_d;
diff --git a/drivers/net/designware_tegra186.c b/drivers/net/designware_tegra186.c
index 0241b9ad16ff..0cbbdb46a442 100644
--- a/drivers/net/designware_tegra186.c
+++ b/drivers/net/designware_tegra186.c
@@ -195,7 +195,7 @@ static int eqos_set_ethaddr_tegra186(struct eth_device *edev, const unsigned cha
* ported to some system where the expectation above is true.
*/
- if (!eqos->started) {
+ if (!edev->active) {
memcpy(eqos->macaddr, mac, 6);
return 0;
}
--
2.30.2
next prev parent reply other threads:[~2022-08-09 6:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-09 6:24 [PATCH 1/4] net: designware: rework Kconfig text and menu structure Ahmad Fatoum
2022-08-09 6:24 ` [PATCH 2/4] net: designware: eqos: stm32: remove duplicate error message Ahmad Fatoum
2022-08-09 6:24 ` Ahmad Fatoum [this message]
2022-08-09 6:24 ` [PATCH 4/4] net: designware: eqos: remove undefined eqos_reset prototype Ahmad Fatoum
2022-08-09 9:32 ` [PATCH 1/4] net: designware: rework Kconfig text and menu structure Sascha Hauer
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=20220809062422.1749563-3-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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