Re: Locking Between User Context and Soft IRQs in 2.4.0

Andrew Morton
2000-11-06T09:56:36Z

Paul Gortmaker wrote:
>
> Assuming that nobody has all the MOD_..._USE_COUNT things culled
> from a tree somewhere already, I quickly hacked up the following
> script for drivers/net:

Looks good. There's also drivers/isdn and possibly other places.

> ...
> We might want to filter the file list created by grep against VERSION_CODE
> as people with that in their driver(s) probably don't want the wholesale
> deletion of MOD_*_COUNT. (OTOH, drivers that have VERSION_CODE that
> supports 2.0.38 or oddball 2.3.x versions could probably be pruned...)

I think you're right. eepro100 and acenic seriously care about 2.2-compatibility
but AFAICT the others just pretend to.

> That still leaves the addition of dev->owner = THIS_MODULE into
> each device probe. One *hackish* way to do this without having to
> deal with each driver could be something like this in netdevice.h
>
> - extern void ether_setup(struct net_device *dev);
> + extern void __ether_setup(struct net_device *dev);
> + static inline void ether_setup(struct net_device *dev){
> + dev->owner = THIS_MODULE;
> + __ether_setup(dev);
> + }
>
> Ugh. Probably should just add it to each probe and be done with it...

mm.. Seeing as failure to set dev->owner is a fatal mistake,
it would be good to enforce this via the compiler type system.

How about making THIS_MODULE an argument to register_netdevice()
and, hence, register_netdev() and init_etherdev()?

> Paul. (aka. monkey #937)

:)