From: Johan Hovold <johan@kernel.org>
To: JackyChou <jackychou@asix.com.tw>
Cc: johan@kernel.org, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
louis@asix.com.tw
Subject: Re: [PATCHv3] USB: serial: mos7840: Add a product ID for the new product
Date: Tue, 27 Nov 2018 07:26:40 -0800 [thread overview]
Message-ID: <20181127152640.GT2403@localhost> (raw)
In-Reply-To: <000a01d48239$68dda550$3a98eff0$@asix.com.tw>
On Thu, Nov 22, 2018 at 04:00:17PM +0800, JackyChou wrote:
>
> From: JackyChou <jackychou@asix.com.tw>
Thanks for the update. This patch appears to have been corrupted (tabs
replaced with spaces) so it cannot be applied. Try sending the patch to
yourself first and make sure you can apply it with git am (and/or run
checkpatch on the result).
> For now, pause to add PID 0x7843 in the driver.
This doesn't belong in the commit message. But there's no reason not to
include the patch adding the PID in the same series. Just send a
two-part series with this patch as the first patch, and the PID one as
the second patch (depending on the first).
Take a look at git-format-patch and git-send-email which can simply the
process.
Also make sure each commit message is self-contained, and that the patch
summary (Subject) reflects what each patch does.
> Simplify the processes of some functions.
Please be a bit more specific.
> Such modifications will not affect the old devices and will make
> the addition of new product (0x7843) more flexible in the future.
This can still stay here.
> Signed-off-by: JackyChou <jackychou@asix.com.tw>
> ---
> drivers/usb/serial/mos7840.c | 48 ++++++++++++------------------------
> 1 file changed, 16 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
> index b42bad85097a..0ca945dce377 100644
> --- a/drivers/usb/serial/mos7840.c
> +++ b/drivers/usb/serial/mos7840.c
> @@ -298,15 +298,10 @@ static int mos7840_set_uart_reg(struct usb_serial_port
> *port, __u16 reg,
> val = val & 0x00ff;
> /* For the UART control registers, the application number need
> to be Or'ed */
> - if (port->serial->num_ports == 4) {
> + if (port->serial->num_ports == 2 && port->port_number != 0)
> + val |= ((__u16)port->port_number + 2) << 8;
> + else
> val |= ((__u16)port->port_number + 1) << 8;
> - } else {
> - if (port->port_number == 0) {
> - val |= ((__u16)port->port_number + 1) << 8;
> - } else {
> - val |= ((__u16)port->port_number + 2) << 8;
> - }
> - }
Perhaps this would be more readable if you used a port offset here as
well, and only make sure to map the second port in the two-port case to
port offset three.
Thanks,
Johan
prev parent reply other threads:[~2018-11-27 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 8:00 [PATCHv3] USB: serial: mos7840: Add a product ID for the new product JackyChou
2018-11-27 15:26 ` Johan Hovold [this message]
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=20181127152640.GT2403@localhost \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jackychou@asix.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=louis@asix.com.tw \
/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