Messages in this thread | | | Date | Fri, 21 Apr 2006 18:14:29 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH 2.6.17-rc2 1/2] return class device pointer from tty_register_device() |
| |
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. - 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/
| |