2019-08-13 12:46:29

by Ioana Ciornei

[permalink] [raw]
Subject: [PATCH v3 00/10] staging: fsl-dpaa2/ethsw: code cleanup

This patch set addresses some of the feedback received on the dpaa2-ethsw
driver: https://lore.kernel.org/patchwork/patch/1113335/.

There are no functional changes but rather just code cleanup.

Changes in v2:
- added Reported-by and Suggested-by tags
Changes in v3:
- fix error path in patch 10/10

Ioana Ciornei (10):
staging: fsl-dpaa2/ethsw: remove IGMP default address
staging: fsl-dpaa2/ethsw: enable switch ports only on dev_open
staging: fsl-dpaa2/ethsw: add line terminator to all formats
staging: fsl-dpaa2/ethsw: remove debug message
staging: fsl-dpaa2/ethsw: use bool when encoding learning/flooding
state
staging: fsl-dpaa2/ethsw: remove unnecessary memset
staging: fsl-dpaa2/ethsw: remove redundant VLAN check
staging: fsl-dpaa2/ethsw: reword error message
staging: fsl-dpaa2/ethsw: register_netdev only when ready
staging: fsl-dpaa2/ethsw: do not force user to bring interface down

drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c | 44 +++++-----
drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 110 ++++++------------------
2 files changed, 50 insertions(+), 104 deletions(-)

--
1.9.1


2019-08-13 15:28:16

by Ioana Ciornei

[permalink] [raw]
Subject: [PATCH v3 09/10] staging: fsl-dpaa2/ethsw: register_netdev only when ready

The register_netdev() call should be made only when ready to process any
user request on the interface. Move the call to be the last one issued
in the probe sequence.

Reported-by: Andrew Lunn <[email protected]>
Signed-off-by: Ioana Ciornei <[email protected]>
---
Changes in v2:
- added Reported-by tag
Changes in v3:
- none

drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index 28da109aef5e..14a9eebf687e 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -1588,23 +1588,21 @@ static int ethsw_probe_port(struct ethsw_core *ethsw, u16 port_idx)
port_netdev->min_mtu = ETH_MIN_MTU;
port_netdev->max_mtu = ETHSW_MAX_FRAME_LENGTH;

+ err = ethsw_port_init(port_priv, port_idx);
+ if (err)
+ goto err_port_probe;
+
err = register_netdev(port_netdev);
if (err < 0) {
dev_err(dev, "register_netdev error %d\n", err);
- goto err_register_netdev;
+ goto err_port_probe;
}

ethsw->ports[port_idx] = port_priv;

- err = ethsw_port_init(port_priv, port_idx);
- if (err)
- goto err_ethsw_port_init;
-
return 0;

-err_ethsw_port_init:
- unregister_netdev(port_netdev);
-err_register_netdev:
+err_port_probe:
free_netdev(port_netdev);

return err;
--
1.9.1