Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753095Ab0ADVhb (ORCPT ); Mon, 4 Jan 2010 16:37:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753020Ab0ADVh3 (ORCPT ); Mon, 4 Jan 2010 16:37:29 -0500 Received: from gateway-1237.mvista.com ([206.112.117.35]:14730 "HELO imap.sh.mvista.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1752848Ab0ADVh2 (ORCPT ); Mon, 4 Jan 2010 16:37:28 -0500 Message-ID: <4B425F80.2070409@ru.mvista.com> Date: Tue, 05 Jan 2010 00:37:04 +0300 From: Sergei Shtylyov User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Eirik Aanonsen Cc: "kernel@avr32linux.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/1] atmel uaba : Adding invert vbus_pin References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1498 Lines: 58 Hello. Eirik Aanonsen wrote: > Adding vbus_pin_inverted so that the usb detect pin can be active high or low. > This because depending on HW implementation it is better to have active low. > Also replaced the pio_get_value(udc->vbus_pin); with a call to vbus_is_present(udc); > > Signed-off-by: Eirik Aanonsen > [...] > diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c > index 4e970cf..1c469d4 100644 > --- a/drivers/usb/gadget/atmel_usba_udc.c > +++ b/drivers/usb/gadget/atmel_usba_udc.c > @@ -320,8 +320,17 @@ static inline void usba_cleanup_debugfs(struct usba_udc *udc) > static int vbus_is_present(struct usba_udc *udc) > { > if (gpio_is_valid(udc->vbus_pin)) > - return gpio_get_value(udc->vbus_pin); > - > + { > + if(udc->vbus_pin_inverted) > Space missing after *if*. > + { > + if( gpio_get_value(udc->vbus_pin) == 1) > Space missing after *if* and there should be no space after (. > + return 0; > + else > + return 1; > Why not simply: return !gpio_get_value(udc->vbus_pin); > + } > + else > } and *else* should be on the same line. Please run your patches thru scripts/checkpatch.pl before submitting... WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/