Re: [PATCH 2.6.17-rc2 1/2] return class device pointer from tty_register_device()

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

 



On Fri, Apr 21, 2006 at 06:14:29PM -0700, Andrew Morton wrote:
> Tilman Schmidt <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux