net: dsa: remove the DSA specific notifiers
This effectively reverts commit60724d4bae
("net: dsa: Add support for DSA specific notifiers"). The reason is that since commit2f1e8ea726
("net: dsa: link interfaces with the DSA master to get rid of lockdep warnings"), it appears that there is a generic way to achieve the same purpose. The only user thus far, the Broadcom SYSTEMPORT driver, was converted to use the generic notifiers. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
1593cd40d7
commit
1dbb130281
@ -833,51 +833,9 @@ static inline int dsa_switch_resume(struct dsa_switch *ds)
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
enum dsa_notifier_type {
|
||||
DSA_PORT_REGISTER,
|
||||
DSA_PORT_UNREGISTER,
|
||||
};
|
||||
|
||||
struct dsa_notifier_info {
|
||||
struct net_device *dev;
|
||||
};
|
||||
|
||||
struct dsa_notifier_register_info {
|
||||
struct dsa_notifier_info info; /* must be first */
|
||||
struct net_device *master;
|
||||
unsigned int port_number;
|
||||
unsigned int switch_number;
|
||||
};
|
||||
|
||||
static inline struct net_device *
|
||||
dsa_notifier_info_to_dev(const struct dsa_notifier_info *info)
|
||||
{
|
||||
return info->dev;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_NET_DSA)
|
||||
int register_dsa_notifier(struct notifier_block *nb);
|
||||
int unregister_dsa_notifier(struct notifier_block *nb);
|
||||
int call_dsa_notifiers(unsigned long val, struct net_device *dev,
|
||||
struct dsa_notifier_info *info);
|
||||
bool dsa_slave_dev_check(const struct net_device *dev);
|
||||
#else
|
||||
static inline int register_dsa_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int unregister_dsa_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int call_dsa_notifiers(unsigned long val, struct net_device *dev,
|
||||
struct dsa_notifier_info *info)
|
||||
{
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static inline bool dsa_slave_dev_check(const struct net_device *dev)
|
||||
{
|
||||
return false;
|
||||
|
@ -309,28 +309,6 @@ bool dsa_schedule_work(struct work_struct *work)
|
||||
return queue_work(dsa_owq, work);
|
||||
}
|
||||
|
||||
static ATOMIC_NOTIFIER_HEAD(dsa_notif_chain);
|
||||
|
||||
int register_dsa_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return atomic_notifier_chain_register(&dsa_notif_chain, nb);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(register_dsa_notifier);
|
||||
|
||||
int unregister_dsa_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return atomic_notifier_chain_unregister(&dsa_notif_chain, nb);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(unregister_dsa_notifier);
|
||||
|
||||
int call_dsa_notifiers(unsigned long val, struct net_device *dev,
|
||||
struct dsa_notifier_info *info)
|
||||
{
|
||||
info->dev = dev;
|
||||
return atomic_notifier_call_chain(&dsa_notif_chain, val, info);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(call_dsa_notifiers);
|
||||
|
||||
int dsa_devlink_param_get(struct devlink *dl, u32 id,
|
||||
struct devlink_param_gset_ctx *ctx)
|
||||
{
|
||||
|
@ -1764,20 +1764,6 @@ int dsa_slave_resume(struct net_device *slave_dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dsa_slave_notify(struct net_device *dev, unsigned long val)
|
||||
{
|
||||
struct net_device *master = dsa_slave_to_master(dev);
|
||||
struct dsa_port *dp = dsa_slave_to_port(dev);
|
||||
struct dsa_notifier_register_info rinfo = {
|
||||
.switch_number = dp->ds->index,
|
||||
.port_number = dp->index,
|
||||
.master = master,
|
||||
.info.dev = dev,
|
||||
};
|
||||
|
||||
call_dsa_notifiers(val, dev, &rinfo.info);
|
||||
}
|
||||
|
||||
int dsa_slave_create(struct dsa_port *port)
|
||||
{
|
||||
const struct dsa_port *cpu_dp = port->cpu_dp;
|
||||
@ -1863,8 +1849,6 @@ int dsa_slave_create(struct dsa_port *port)
|
||||
goto out_gcells;
|
||||
}
|
||||
|
||||
dsa_slave_notify(slave_dev, DSA_PORT_REGISTER);
|
||||
|
||||
rtnl_lock();
|
||||
|
||||
ret = register_netdevice(slave_dev);
|
||||
@ -1913,7 +1897,6 @@ void dsa_slave_destroy(struct net_device *slave_dev)
|
||||
phylink_disconnect_phy(dp->pl);
|
||||
rtnl_unlock();
|
||||
|
||||
dsa_slave_notify(slave_dev, DSA_PORT_UNREGISTER);
|
||||
phylink_destroy(dp->pl);
|
||||
gro_cells_destroy(&p->gcells);
|
||||
free_percpu(slave_dev->tstats);
|
||||
|
Loading…
Reference in New Issue
Block a user