Re: [PATCH] omap: usbhs: Fixed the crash during rmmod of ehci and ohci

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

 



Hi,

On Mon, May 09, 2011 at 03:58:53PM +0530, Munegowda, Keshava wrote:
> I you see only the patch ; its looks like variable halt is not needed;
> 
> If the code; it will be set only when the clocks are disabled;
> Then after restoring irq, you will free the gpio based on this value.

that code is wrong in so many ways that it's difficult to reply, but in
short:

. get rid of the magic constants, define some macros
. instead of using only one error label, use several each one taking
	care of a different case (that will allow you to remove halt flag)
. timeout is never reset, meaning after the first loop, the time_after()
	will always be true.
. this omap->count is ugly.
. you shouldn't be accessing pdata on the exit path
. that save in spin_lock_irqsave() looks unnecessary. Wouldn't
	spin_lock_irq() be enough ?

-- 
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux