public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: Alon Ziv <alon+git@nolaviz.org>,
	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 05:34:53 -0700	[thread overview]
Message-ID: <20101010123453.GA21060@kroah.com> (raw)
In-Reply-To: <4CB19B1F.9000300@ru.mvista.com>

On Sun, Oct 10, 2010 at 02:53:19PM +0400, Sergei Shtylyov wrote:
> 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.

Not a big deal.

>> +	} else {
>> +		struct usb_ctrlrequest *dr;
>> +
>> +		dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
>
>    sizeof(*dr) is a preferred form.

No, people disagree on this, there is no 'preferred' form, you are free
to use either way.

>> +		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...

It's fine, not a big deal.

thanks,

greg k-h

  reply	other threads:[~2010-10-10 12:34 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
2010-10-10 12:34     ` Greg KH [this message]
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=20101010123453.GA21060@kroah.com \
    --to=greg@kroah.com \
    --cc=alon+git@nolaviz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sshtylyov@mvista.com \
    /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