On Thu, 22 Sep 2005, Andy Chuo wrote:

> Hi Alan,
> For some reasons, I still can't get it to work.
> The following is the init part of my code:
> static int __init myudc_init (void)
> {     
>       struct socle_lp2a_udc *dev;
>       int retval;
>       
>       INFO(KERN_DEBUG "%s: version %s\n", driver_name, DRIVER_VERSION);
> 
>       /* allocate resources */
>       if (!request_mem_region(REGISTER_FIRST, REGISTER_LENGTH,
> driver_name))
>               return -EBUSY;
> 
>       /* initialize data */
>       dev = &memory;
> 
>       the_controller = dev;
>       udc_reinit(dev);
> 
>       /* irq setup after old hardware state is cleaned up */
>       retval = request_irq(INO_UDC, my_udc_irq,
>                       SA_INTERRUPT, driver_name, dev);
>       if (retval != 0) {
>               printk(KERN_ERR "%s: can't get irq %i, err %d\n",
>                       driver_name, INO_UDC, retval);
>               return -EBUSY;
>       }
>       dev->got_irq = 1;
> 
>       create_proc_files();
> 
>       return 0;
> }
> module_init (myudc_init);
> 
> andy ideas?

Well, it's immediately obvious that if request_irq fails you don't give 
back the memory region requested earlier.  Nor do you undo udc_reinit(), 
although perhaps it doesn't need to be undone.

There may be similar errors in the exit procedure.  Why don't you try 
doing what I suggested in my previous email message?

Alan Stern



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to