From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <590d4ca16a9d61afc0bdc6b4d16862af@brasstown.quanstro.net> References: <40707a306f2cb1caf97b21f639f8a9f5@brasstown.quanstro.net> <590d4ca16a9d61afc0bdc6b4d16862af@brasstown.quanstro.net> Date: Sun, 23 Mar 2014 22:08:20 +0100 Message-ID: From: Gorka Guardiola To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [9fans] usb/serial control open Topicbox-Message-UUID: ceb58074-ead8-11e9-9d60-3106f5b1d025 >> >> 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.