From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Eirik Aanonsen <EAA@wprmedical.com>
Cc: "kernel@avr32linux.org" <kernel@avr32linux.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] atmel uaba : Adding invert vbus_pin
Date: Tue, 05 Jan 2010 00:37:04 +0300 [thread overview]
Message-ID: <4B425F80.2070409@ru.mvista.com> (raw)
In-Reply-To: <B5E0EDE940845B429B7ECCE186529F2C0641D177FD@dware2702>
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 <eaa@wprmedical.com>
>
[...]
> 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
next prev parent reply other threads:[~2010-01-04 21:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-04 13:01 [PATCH 1/1] atmel uaba : Adding invert vbus_pin Eirik Aanonsen
2010-01-04 21:37 ` Sergei Shtylyov [this message]
2010-01-04 21:54 ` Ben Nizette
2010-01-15 18:54 ` Greg KH
2010-01-18 7:02 ` Eirik Aanonsen
2010-01-19 4:49 ` Greg KH
2010-01-19 7:16 ` Eirik Aanonsen
2010-01-27 22:40 ` Greg KH
2010-02-05 8:49 ` Eirik Aanonsen
-- strict thread matches above, loose matches on Subject: below --
2010-01-05 8:47 Eirik Aanonsen
2010-01-13 13:20 ` Eirik Aanonsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B425F80.2070409@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=EAA@wprmedical.com \
--cc=kernel@avr32linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.