[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6c20043398a8543fb69795be5ab1e200613fb881.1632565508.git.leonro@nvidia.com>
Date: Sat, 25 Sep 2021 14:22:52 +0300
From: Leon Romanovsky <leon@...nel.org>
To: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: Leon Romanovsky <leonro@...dia.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Andrew Lunn <andrew@...n.ch>, Ariel Elior <aelior@...vell.com>,
Bin Luo <luobin9@...wei.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Coiby Xu <coiby.xu@...il.com>,
Derek Chickles <dchickles@...vell.com>, drivers@...sando.io,
Felix Manlunas <fmanlunas@...vell.com>,
Florian Fainelli <f.fainelli@...il.com>,
Geetha sowjanya <gakula@...vell.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
GR-everest-linux-l2@...vell.com, GR-Linux-NIC-Dev@...vell.com,
hariprasad <hkelam@...vell.com>,
Ido Schimmel <idosch@...dia.com>,
Intel Corporation <linuxwwan@...el.com>,
intel-wired-lan@...ts.osuosl.org,
Ioana Ciornei <ioana.ciornei@....com>,
Jerin Jacob <jerinj@...vell.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Jiri Pirko <jiri@...dia.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
Linu Cherian <lcherian@...vell.com>,
linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-staging@...ts.linux.dev,
Loic Poulain <loic.poulain@...aro.org>,
Manish Chopra <manishc@...vell.com>,
M Chetan Kumar <m.chetan.kumar@...el.com>,
Michael Chan <michael.chan@...adcom.com>,
Michael Guralnik <michaelgur@...lanox.com>,
netdev@...r.kernel.org, oss-drivers@...igine.com,
Richard Cochran <richardcochran@...il.com>,
Saeed Mahameed <saeedm@...dia.com>,
Satanand Burla <sburla@...vell.com>,
Sergey Ryazanov <ryazanov.s.a@...il.com>,
Shannon Nelson <snelson@...sando.io>,
Simon Horman <simon.horman@...igine.com>,
Subbaraya Sundeep <sbhatta@...vell.com>,
Sunil Goutham <sgoutham@...vell.com>,
Taras Chornyi <tchornyi@...vell.com>,
Tariq Toukan <tariqt@...dia.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
UNGLinuxDriver@...rochip.com, Vadym Kochan <vkochan@...vell.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>
Subject: [PATCH net-next v1 12/21] net: mscc: ocelot: delay devlink registration to the end
From: Leon Romanovsky <leonro@...dia.com>
Open access to the devlink interface when the driver fully initialized.
Signed-off-by: Leon Romanovsky <leonro@...dia.com>
---
drivers/net/ethernet/mscc/ocelot_vsc7514.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index 2b8ea48d2fc4..5d01993f6be0 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -1134,7 +1134,6 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
if (err)
goto out_put_ports;
- devlink_register(devlink);
err = mscc_ocelot_init_ports(pdev, ports);
if (err)
goto out_ocelot_devlink_unregister;
@@ -1157,6 +1156,7 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
register_switchdev_blocking_notifier(&ocelot_switchdev_blocking_nb);
of_node_put(ports);
+ devlink_register(devlink);
dev_info(&pdev->dev, "Ocelot switch probed\n");
@@ -1166,7 +1166,6 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
mscc_ocelot_release_ports(ocelot);
mscc_ocelot_teardown_devlink_ports(ocelot);
out_ocelot_devlink_unregister:
- devlink_unregister(devlink);
ocelot_deinit(ocelot);
out_put_ports:
of_node_put(ports);
@@ -1179,11 +1178,11 @@ static int mscc_ocelot_remove(struct platform_device *pdev)
{
struct ocelot *ocelot = platform_get_drvdata(pdev);
+ devlink_unregister(ocelot->devlink);
ocelot_deinit_timestamp(ocelot);
ocelot_devlink_sb_unregister(ocelot);
mscc_ocelot_release_ports(ocelot);
mscc_ocelot_teardown_devlink_ports(ocelot);
- devlink_unregister(ocelot->devlink);
ocelot_deinit(ocelot);
unregister_switchdev_blocking_notifier(&ocelot_switchdev_blocking_nb);
unregister_switchdev_notifier(&ocelot_switchdev_nb);
--
2.31.1
Powered by blists - more mailing lists