Re: [RFC v6] rfkill: rewrite

Henrique de Moraes Holschuh
2009-04-30T15:53:20Z

On Thu, 30 Apr 2009, Johannes Berg wrote:
> > The return values for rfkill_alloc() are not the same on the stub and
> > real functions. The stub function uses ERR_PTR, while the real
> > function uses NULL for any errors. Please make them do the same
> > thing, and it is probably a damn good idea to document in the
> > kerneldoc what kind of return values one should expect when you return
> > a pointer and the function can fail (i.e. NULL or ERR_PTR).
>
> Actually, I was going to clean this up, and then I noticed you're
> wrong. :) Returning ERR_PTR(-ENODEV) is intentional, in the non-RFKILL
> case. Imagine a driver like this:

Well, that's confusing as all heck... document it, please? I still think in
that case, we'd be better off if rfkill_alloc always uses the ERR_PTR
convention.

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh