}
static const struct wwan_ops mhi_wwan_ops = {
- .owner = THIS_MODULE,
.priv_size = sizeof(struct mhi_net_dev),
.setup = mhi_net_setup,
.newlink = mhi_net_newlink,
struct mhi_net_dev *mhi_netdev = dev_get_drvdata(&mhi_dev->dev);
struct mhi_controller *cntrl = mhi_dev->mhi_cntrl;
- /* rtnetlink takes care of removing remaining links */
+ /* WWAN core takes care of removing remaining links */
wwan_unregister_ops(&cntrl->mhi_dev->dev);
if (create_default_iface)
return -EBUSY;
}
- if (!try_module_get(ops->owner)) {
- wwan_remove_dev(wwandev);
- return -ENODEV;
- }
-
wwandev->ops = ops;
wwandev->ops_ctxt = ctxt;
void wwan_unregister_ops(struct device *parent)
{
struct wwan_device *wwandev = wwan_dev_get_by_parent(parent);
- struct module *owner;
LIST_HEAD(kill_list);
if (WARN_ON(IS_ERR(wwandev)))
*/
put_device(&wwandev->dev);
- owner = wwandev->ops->owner; /* Preserve ops owner */
-
rtnl_lock(); /* Prevent concurent netdev(s) creation/destroying */
/* Remove all child netdev(s), using batch removing */
rtnl_unlock();
- module_put(owner);
-
wwandev->ops_ctxt = NULL;
wwan_remove_dev(wwandev);
}
}
static const struct wwan_ops wwan_hwsim_wwan_rtnl_ops = {
- .owner = THIS_MODULE,
.priv_size = 0, /* No private data */
.setup = wwan_hwsim_netdev_setup,
};
/**
* struct wwan_ops - WWAN device ops
- * @owner: module owner of the WWAN ops
* @priv_size: size of private netdev data area
* @setup: set up a new netdev
* @newlink: register the new netdev
* @dellink: remove the given netdev
*/
struct wwan_ops {
- struct module *owner;
unsigned int priv_size;
void (*setup)(struct net_device *dev);
int (*newlink)(void *ctxt, struct net_device *dev,