Re: Device node at /dev/tty* not getting created for uart serial driver

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

 



On Wed, Nov 28, 2012 at 01:35:16PM +0530, Manavendra Nath Manav wrote:
> On Mon, Nov 26, 2012 at 2:02 PM, Jinqiang Zeng <jinqiangzeng@xxxxxxxxx> wrote:
> >
> > first creat a device class,then register a device to the kernel. using the following functions:
> > struct class *class_create(struct module *owner, char *name);
> >  struct class_device *class_device_create(struct class *cls,
> >                       struct class_device *parent,
> >                       dev_t devt,
> >                       struct device *device, char *fmt, ...)

No, you don't need to do that for a tty device, the tty core handles
that all for you automatically.

> > 2012/11/26 Manavendra Nath Manav <mnm.kernel@xxxxxxxxx>
> >> On Sat, Nov 24, 2012 at 2:20 PM, Manavendra Nath Manav <mnm.kernel@xxxxxxxxx> wrote:
> >>>
> >>> Hi RK
> >>>
> >>> On Sat, Nov 24, 2012 at 2:03 PM, Manavendra Nath Manav <mnm.kernel@xxxxxxxxx> wrote:
> >>>>
> >>>> I have written a simple UART serial driver in embedded Linux running busybox with mdev rules. I have provided .dev_name as "ttyC2C" in my driver code.
> >>>>
> >>>> static struct uart_driver serial_omap_reg = {
> >>>>    .owner      = THIS_MODULE,
> >>>>    .driver_name   = "Omap-C2C-Serial",
> >>>>    .dev_name   = "ttyC2C",

There is your name, the port number is added to the end of the name, as
a number, which you observe:

> >>>> However the node is getting created in
> >>>>
> >>>> ./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
> >>>> ./sys/class/tty/ttyC2C0

That is exactly correct, the kernel is working properly.  You do not
name a tty device without a number at the end, that is not how the tty
layer in Linux works.

> >>>> How to get device node as /dev/ttyC2C ?

You do not, you get the node at /dev/ttyC2C0.  If you want it only at
ttyC2C, then you need to write your own udev/mdev rule, renaming it.
But that's not a kernel issue, it's a userspace configuration issue, and
one that I do not recommend at all.

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux