Guennadi,
I think the problem is with dynamic Major and Minor Addresses.
This is the code from serial_core.c ...
"
static int serial_match_port(struct device *dev, void *data)
{
struct uart_match *match = data;
dev_t devt = MKDEV(match->driver->major, match->driver->minor) +
match->port->line;
return dev->devt == devt; /* Actually, only one tty per port */
}
"
Well when you uses Dynamic Major and Minor number you set it equal to 0
in the driver structure of the UART.
Example.
"
static struct uart_driver uart_driver = {
.owner = THIS_MODULE,
.driver_name = "msm_serial",
.dev_name = "ttyS0",
.major = 0, /* tty layer will assign the major id */
.minor = 0,
.nr = UART_MAX_COUNT,
.cons = uart_console,
};
"
You match function does not work. At least this is my thoughts. What
do you think.
Can you try to use Dynamic Major and Minor address and see if you
driver works.
Thank You
Vipul
-----Original Message-----
From: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
To: vcgandhi1@xxxxxxx
Cc: linux-serial@xxxxxxxxxxxxxxx
Sent: Thu, 17 Apr 2008 7:55 am
Subject: Re: Change to serial_core.c .... causing my serial driver
problem Help Request
On Wed, 16 Apr 2008, vcgandhi1@xxxxxxx wrote:
I do the same
port->dev = &dev->dev;
But I am not sure &dev->dev points to the parent. I think it points
to the
device it's self, but I may be wrong. I have tried port->dev =
&dev->dev as
well as port->dev = dev->dev.parent.
It depends on what your "dev" is, and this is driver-specific. So,
unfortunately, I don't think I'll be able to help you any further
without
seeing the sources.
One of these found something when the
port was TTYS0 but did not work when the port was TTYS2.
Did you test with a non zero port->line. I working on ttyS2.
Yes, I tested it with ttyS0 and ttyS1.
Just trying to narrow down what could be wrong. It just that
tty_dev = device_find_child(port->dev, &match, serial_match_port);
is returning NULL for me.
Thank You for your help.
Vipul
PS. One quick suggestion you may want to check the return value and
verify it
is non-NULL before using it. Makes it easier to debug the code. ...
Feel free to submit a patch.
Thanks
Guennadi
---
Guennadi Liakhovetski
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html