From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Alon Ziv <alon+git@nolaviz.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] Add Opticon OPN2001 write support
Date: Sun, 10 Oct 2010 14:53:19 +0400 [thread overview]
Message-ID: <4CB19B1F.9000300@ru.mvista.com> (raw)
In-Reply-To: <1286692340-18639-3-git-send-email-alon-git@nolaviz.org>
Hello.
On 10-10-2010 10:32, Alon Ziv wrote:
> OPN2001 expects write operations to arrive as a vendor-specific command
> through the control pipe (instead of using a separate bulk-out pipe).
> Signed-off-by: Alon Ziv<alon-git@nolaviz.org>
> ---
> drivers/usb/serial/opticon.c | 30 ++++++++++++++++++++++++++----
> 1 files changed, 26 insertions(+), 4 deletions(-)
> diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
> index 9ff19c8..4fe7c3d 100644
> --- a/drivers/usb/serial/opticon.c
> +++ b/drivers/usb/serial/opticon.c
[...]
> @@ -237,10 +240,29 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
>
> usb_serial_debug_data(debug,&port->dev, __func__, count, buffer);
>
> - usb_fill_bulk_urb(urb, serial->dev,
> - usb_sndbulkpipe(serial->dev,
> - port->bulk_out_endpointAddress),
> - buffer, count, opticon_write_bulk_callback, priv);
> + if (port->bulk_out_endpointAddress) {
> + usb_fill_bulk_urb(urb, serial->dev,
> + usb_sndbulkpipe(serial->dev,
> + port->bulk_out_endpointAddress),
> + buffer, count, opticon_write_bulk_callback, priv);
Please align all follow-up lines uniformly.
> + } else {
> + struct usb_ctrlrequest *dr;
> +
> + dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
sizeof(*dr) is a preferred form.
> + usb_fill_control_urb(urb, serial->dev,
> + usb_sndctrlpipe(serial->dev, 0),
> + (unsigned char *)dr, buffer, count,
> + opticon_write_bulk_callback, priv);
More tabs needed for alignment, I think...
WBR, Sergei
next prev parent reply other threads:[~2010-10-10 10:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-10 6:32 [PATCH 0/3] opticon driver fixes Alon Ziv
2010-10-10 6:32 ` [PATCH 1/3] Fix long-standing bugs in opticon driver Alon Ziv
2010-10-10 6:32 ` [PATCH 2/3] Add Opticon OPN2001 write support Alon Ziv
2010-10-10 10:53 ` Sergei Shtylyov [this message]
2010-10-10 12:34 ` Greg KH
2010-10-10 13:58 ` Sergei Shtylyov
2010-10-10 14:52 ` Greg KH
2010-10-10 6:32 ` [PATCH 3/3] Whitespace fixes in opticon driver Alon Ziv
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=4CB19B1F.9000300@ru.mvista.com \
--to=sshtylyov@mvista.com \
--cc=alon+git@nolaviz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox