Re: [PATCH 2/2] OMAP3: rx51: specify phy_power for usb tranceiver

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

 



On Mon, Mar 21, 2011 at 04:40:26PM +0200, Aaro Koskinen wrote:
> Hi,
> 
> On Mon, 21 Mar 2011, Sergei Shtylyov wrote:
> >>This patch allows the ISP1707 USB tranceiver on Nokia
> >>N900 to be disabled when usb cable is disconnected.
> >>This saves approximately 14mA of battery current.
> >
> >>Patch based on work done by Heikki Krogerus on N900
> >>maemo kernel.
> >
> >>Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@xxxxxxxxx>
> >>Cc: Heikki Krogerus <heikki.krogerus@xxxxxxxxx>
> >>---
> >> arch/arm/mach-omap2/board-rx51-peripherals.c |   32
> >>++++++++++++++++++++++++++
> >> 1 files changed, 32 insertions(+), 0 deletions(-)
> >
> >>diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c
> >>b/arch/arm/mach-omap2/board-rx51-peripherals.c
> >>index e75e240..9dd22bc 100644
> >>--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
> >>+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
> >[...]
> >>@@ -534,8 +537,36 @@ static struct twl4030_gpio_platform_data
> >>rx51_gpio_data = {
> >> 	.setup			= rx51_twlgpio_setup,
> >> };
> >> +static void __init rx51_xceiv_init(void)
> >>+{
> >>+	if (gpio_request(RX51_USB_TRANSCEIVER_RST_GPIO, NULL) < 0)
> >>+		BUG();
> >
> >  Why not:
> >
> >	BUG_ON(gpio_request(RX51_USB_TRANSCEIVER_RST_GPIO, NULL) < 0);
> 
> Well, there should not be no BUG() there in the first place. If the GPIO
> cannot be requested there should be an error log and phy_power should
> be set to NULL.

Yes, NEVER add a BUG() call in a driver, you just crashed the whole
machine, which is not nice at all to anyone involved.

thanks,

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


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux