Messages in this thread Patch in this message | ![/](/images/icornerl.gif) | | From | Thomas Schlichter <> | Subject | Re: Error during compile of 2.5.69-mm8 | Date | Fri, 23 May 2003 03:06:45 +0200 |
| |
On May 23, David S. Miller wrote: > From: Thomas Schlichter <schlicht@uni-mannheim.de> > Date: Fri, 23 May 2003 02:13:34 +0200 > > > Therefore, it was a complete error for anyone else to start using this > > macro for other structures. > > So nobody should better use THIS_MODULE?! > > No, it is exactly what they should use. > > They should avoid using SET_MODULE_OWNER.
This is clear to me, of course, it should have been just a very extreme example...
> For ME and many other driver developers SET_MODULE_OWNER does not belong > to netdevice, it belongs to the module infrastructure! > > Then by changing SET_MODULE_OWNER you will break source backwards > compatability for every single network device driver out there, > something I was explicitly trying to avoid.
OK, now I see clearer... What you did broke everything but netdevices and what I did broke nothing but netdevices... So I attached a very small patch that will help braking nothing... ;-)
> SET_MODULE_OWNER() is a bogus interface because it is typeless. > > Therefore I suggest that you create macros specific to your individual > structures, and use these to achieve 2.4.x/2.5.x build compatability > in setting the ->owner field of such structs.
That is a good idea, but how should we get rid off this when it is used over and over??
Best regards Thomas Schlichter --- linux-2.5.69-bk15/include/linux/module.h.orig Fri May 23 02:42:07 2003 +++ linux-2.5.69-bk15/include/linux/module.h Fri May 23 02:45:39 2003 @@ -438,6 +438,10 @@ #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) +#ifndef SET_MODULE_OWNER +#define SET_MODULE_OWNER(dev) ((dev)->owner = THIS_MODULE) +#endif + /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ struct obsolete_modparm { --- linux-2.5.69-bk15/include/linux/netdevice.h.orig Fri May 23 02:48:53 2003 +++ linux-2.5.69-bk15/include/linux/netdevice.h Fri May 23 02:49:06 2003 @@ -451,6 +451,7 @@ struct kobject stats_kobj; }; +#undef SET_MODULE_OWNER #define SET_MODULE_OWNER(dev) do { } while (0) /* Set the sysfs physical device reference for the network logical device * if set prior to registration will cause a symlink during initialization.[unhandled content-type:application/pgp-signature] | ![\](/images/icornerr.gif) |