2005-01-20 15:10:10

by Rogier Wolff

[permalink] [raw]
Subject: Bug when using custom baud rates....

Hi,

When using custom baud rates, the code does:


if ((new_serial.baud_base != priv->baud_base) ||
(new_serial.baud_base < 9600))
return -EINVAL;

Which translates to english as:

If you changed the baud-base, OR the new one is
invalid, return invalid.

but it should be:

If you changed the baud-base, OR the new one is
invalid, return invalid.

Patch attached.

Roger.

--
** [email protected] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement.
Does it sit on the couch all day? Is it unemployed? Please be specific!
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ


Attachments:
(No filename) (794.00 B)
ftdi_fix (541.00 B)
Download all attachments

2005-01-20 15:25:52

by Rogier Wolff

[permalink] [raw]
Subject: Re: Bug when using custom baud rates....

On Thu, Jan 20, 2005 at 07:08:58AM -0800, Greg KH wrote:
> On Thu, Jan 20, 2005 at 03:54:22PM +0100, Rogier Wolff wrote:
> > Hi,
> >
> > When using custom baud rates, the code does:
> >
> >
> > if ((new_serial.baud_base != priv->baud_base) ||
> > (new_serial.baud_base < 9600))
> > return -EINVAL;
> >
> > Which translates to english as:
> >
> > If you changed the baud-base, OR the new one is
> > invalid, return invalid.
> >
> > but it should be:
> >
> > If you changed the baud-base, OR the new one is
> > invalid, return invalid.
>
> You mean AND, not OR here, right? :)

:-) Sorry. Too noisy here.

> > Patch attached.
>
> Have a 2.6 patch?

Patch told me:
patching file drivers/usb/serial/ftdi_sio.c
Hunk #1 succeeded at 1137 (offset 156 lines).

but the resulting patch is attached.

Roger.

--
+-- Rogier Wolff -- http://www.harddisk-recovery.nl -- 0800 220 20 20 --
| Files foetsie, bestanden kwijt, alle data weg?!
| Blijf kalm en neem contact op met Harddisk-recovery.nl!


Attachments:
(No filename) (1.02 kB)
ftdi_2.6fix (499.00 B)
Download all attachments

2005-01-21 00:14:19

by Greg KH

[permalink] [raw]
Subject: Re: Bug when using custom baud rates....

On Thu, Jan 20, 2005 at 04:22:56PM +0100, Rogier Wolff wrote:
> On Thu, Jan 20, 2005 at 07:08:58AM -0800, Greg KH wrote:
> > On Thu, Jan 20, 2005 at 03:54:22PM +0100, Rogier Wolff wrote:
> > > Hi,
> > >
> > > When using custom baud rates, the code does:
> > >
> > >
> > > if ((new_serial.baud_base != priv->baud_base) ||
> > > (new_serial.baud_base < 9600))
> > > return -EINVAL;
> > >
> > > Which translates to english as:
> > >
> > > If you changed the baud-base, OR the new one is
> > > invalid, return invalid.
> > >
> > > but it should be:
> > >
> > > If you changed the baud-base, OR the new one is
> > > invalid, return invalid.
> >
> > You mean AND, not OR here, right? :)
>
> :-) Sorry. Too noisy here.
>
> > > Patch attached.
> >
> > Have a 2.6 patch?
>
> Patch told me:
> patching file drivers/usb/serial/ftdi_sio.c
> Hunk #1 succeeded at 1137 (offset 156 lines).
>
> but the resulting patch is attached.

Applied, thanks.

greg k-h