lkml.org 
[lkml]   [2006]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2.6.17-rc2 1/2] return class device pointer from tty_register_device()
On Fri, Apr 21, 2006 at 06:14:29PM -0700, Andrew Morton wrote:
> Tilman Schmidt <tilman@imap.cc> wrote:
> >
> > + * Returns a pointer to the class device (or NULL on error).
> > + *
> > * This call is required to be made to register an individual tty device if
> > * the tty driver's flags have the TTY_DRIVER_NO_DEVFS bit set. If that
> > * bit is not set, this function should not be called.
> > */
> > -void tty_register_device(struct tty_driver *driver, unsigned index,
> > - struct device *device)
> > +struct class_device *tty_register_device(struct tty_driver *driver,
> > + unsigned index, struct device *device)
> > {
>
> It would be better to make this return ERR_PTR(-Efoo) on error, rather than
> NULL.
>
> That way, tty_register_device() ends with
>
> - class_device_create(tty_class, NULL, dev, device, "%s", name);
> + return class_device_create(tty_class, NULL, dev, device, "%s", name);
> }
>
> which is neat.

I agree, that would be nicer.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-22 21:58    [W:0.326 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site