Messages in this thread | | | Date | Tue, 3 Feb 1998 13:36:47 -0500 (EST) | From | Jim Bray <> | Subject | Re: 2.1.83: Sound, SB16, Modules, MIDI? |
| |
On Tue, 3 Feb 1998, Alan Cox wrote:
> > making a wired driver as opposed to a module could also be specified in > > the module case, and be made available to the driver, i.e.: > > Possibly. It needs to allow you to default it to the unset value however. > Isee no big problem with it. >
Right. I think you mean use some odd value such as 0xdeadbeef to indicate to the module that no value was set for the param, and that it should use its own defaults, which in the case I cited were -1. In all cases, allowing args to the module to override.
A slightly different plan, which would require closer coupling between the driver code and the config mechanism, would be for each driver param to have both a wired-default and a module-default value.
I haven't studied that code, so this may be off, but a third idea would be to have code in init_module to the effect of
#ifdef DRIVER_PARAM_X x = DRIVER_PARAM_X #else x = <some default> #endif
which is a bit cumbersome and ugly. Perhaps something could be done with the MODULE() macro.
--Jim <a href="http://as220.org/jb"> My Page</a>
| |