Guennadi,
My driver does the same as jsm_init_module. I would be very surprised
if jsm actually worked with your change. You need to test it under
suspend and resume condition.
My driver does the same uart_register_driver/tty_register_driver, but
it looks like tty_register_driver sets the major address for the tty
structure, but that does not get set back in the uart_driver structure.
So uart_driver structure is still at zero.
To try to simplify this a little.
tty_register_driver will fill in the major and minor address in the
following structure. struct tty_driver *driver
uart_register_driver input is struct uart_driver *drv. The value never
gets set back into uart_driver and that is where you are looking to do
the match.
To me this is either a bug in uart_register_driver for not propagating
the value into uart_driver structure. But again it really did not
matter since no one was looking at it till you modified the code.
Or your change should look at the tty_driver structure not the
uart_driver structure, easy enough change. I do not think it is good
for the lower level driver to fill in the value. It should not have to
look at the tty structure it is suppose to be abstracted out.
Vipul
My recommendation is change you test driver to use 0 as the major
address and do a suspend. It should crash.
-----Original Message-----
From: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
To: vcgandhi1@xxxxxxx
Cc: linux-serial@xxxxxxxxxxxxxxx
Sent: Thu, 17 Apr 2008 10:19 am
Subject: Re: Change to serial_core.c .... causing my serial driver
problem Help Request
On Thu, 17 Apr 2008, vcgandhi1@xxxxxxx wrote:
When I switch to static Major and Minor numbers, the code started to
work. So
I believe the issue is with dynamic Major and Minor number.
I still don't understand. drivers/serial/jsm/jsm_driver.c does the
same.
But as it calls in its jsm_init_module:
uart_register_driver
tty_register_driver
where
if (!driver->major) {
error = alloc_chrdev_region(&dev, driver->minor_start,
driver->num, driver->name);
if (!error) {
driver->major = MAJOR(dev);
driver->minor_start = MINOR(dev);
}
then it does get non-zero major and minor numbers. Doesn't this work
for
you?
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