On Wed, Jan 24, 2007 at 02:49:03PM +0100, Nathael Pajani wrote:
> Hi all.
> 
> Johannes H??lzl wrote :
> >Hi Nathael,
> >
> >     To solve this the new_id is added under the serial driver directory 
> >     at:
> >
> >     /sys/bus/usb-serial/drivers/<driver>/new_id
> >
> OK, I do not have this new_id file as I must use 2.6.19.2 (stable kernel) 
> for my client and do not want to backport all the USB from 2.6.20.
> 
> But then, your solution is in fact allright.
> 
> I got two other points though, both in drivers/usb/serial/usb-serial.c :
> 
>       - get_iface_id() can be written without the goto statement (I have 
>       been told to avoid them as much as possible)

Whoever told you that never did any real-world programming involving
error paths and locking and memory allocations.  In the kernel, it is
preferable to use gotos to keep code paths sane and to make sure you
clean up properly from errors.  So this patch is not needed, or
encouraged.

>       - usb_serial_probe() is not laid out in a way wich pleases me, and 
>       this may be useful for others:
>          the call to type->calc_num_ports(serial); is done before the
>               serial->num_bulk_in = num_bulk_in;
>               serial->num_bulk_out = num_bulk_out;
>               serial->num_interrupt_in = num_interrupt_in;
>               serial->num_interrupt_out = num_interrupt_out;
>          so we did calculations to find them, and do not pass them to
>          calc_num_ports(), which has to compute again if it needs any
>          of them.

Your driver needs this information in order to determine the number of
ports?  Can't you go off of the device id?

If not, then yes, when your driver is accepted into the kernel tree, I'd
be glad to take a patch moving these values to be set before the call to
calc_num_ports.

> I may come with more stuff, as my driver is a WIP.

Which device are you creating a driver for?

thanks,

greg k-h

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to