tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Changing the return value of xxx_attach() from void to int.



On Thu, 23 Jun 2016, Paul Goyette wrote:

On Thu, Jun 23, 2016 at 07:40:14PM +0900, Masanobu SAITOH wrote:
 As you know, the return value of device driver's attach function is void.
I've thought that we should change it to int for many years. I believe I'm
not the only person.

I have always been surprised to see that we don't already have a return value. I really think that a meaningful code, more than success/fail, is useful.

I'd also want to make sure that the change "plays nicely" with drivers for pseudo-devices as well as devices. I'd also want to see that the change doesn't break any modular drivers; especially for pseudo-devs which have a some interesting attach() issues when built as modules.

Oh, yeah, one more thing...

I expressed already my concerns about having a single cut-over point, at which all drivers need to change simultaneously. I'd much rather see a mechanism to support old and new approaches, so drivers can be converted in a more leisurely fashion.

But please, let's not call it CFATTACH_DECL_NEW_NEW   :)


+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


Home | Main Index | Thread Index | Old Index