>> >> And setonce needs to live in the interface, and it needs to be locked, etc. > > another idea: since this is only needed by some hardware. and then only in > init. > why not make it the responsibility of such hardware to do this in the init > fn. then the problem can be addressed without any special cases like > !setonce. > > what do you think? >
Init is probably the right place to do that, except I wouldn't configure interfaces I am not going to use, because, some times, they are connected to funky things (like jtag, for example). I used open to do it on-demand. I don't know if it was the right decision, but that was the rationale behind it. If you think there is a better way, proceed :-). G.