From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Crescent Hsieh <crescentcy.hsieh@moxa.com>
Cc: Jiri Slaby <jirislaby@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH 4/6] tty: serial: 8250: Add check for setting default serial interface
Date: Sat, 8 Jun 2024 12:57:23 +0300 [thread overview]
Message-ID: <ZmQrA2_TjgK33uhn@surfacebook.localdomain> (raw)
In-Reply-To: <20240607114336.4496-5-crescentcy.hsieh@moxa.com>
Fri, Jun 07, 2024 at 07:43:34PM +0800, Crescent Hsieh kirjoitti:
> Moxa PCIe and Mini-PCIe boards are capable of switching the serial
> interface through software control, while other PCI boards switch the
> serial interface through hardware DIP switches.
>
> This patch adds a check while setting the default serial interface.
...
> +static bool pci_moxa_is_pcie(unsigned short device)
Please, avoid potential collisions in the namespace, i.e.
start your function names with moxa, and not with pci.
This can be amended once you split out 8250_moxa.
> +{
> + if (device == PCI_DEVICE_ID_MOXA_CP102E ||
> + device == PCI_DEVICE_ID_MOXA_CP102EL ||
> + device == PCI_DEVICE_ID_MOXA_CP104EL_A ||
> + device == PCI_DEVICE_ID_MOXA_CP114EL ||
> + device == PCI_DEVICE_ID_MOXA_CP116E_A_A ||
> + device == PCI_DEVICE_ID_MOXA_CP116E_A_B ||
> + device == PCI_DEVICE_ID_MOXA_CP118EL_A ||
> + device == PCI_DEVICE_ID_MOXA_CP118E_A_I ||
> + device == PCI_DEVICE_ID_MOXA_CP132EL ||
> + device == PCI_DEVICE_ID_MOXA_CP134EL_A ||
> + device == PCI_DEVICE_ID_MOXA_CP138E_A ||
> + device == PCI_DEVICE_ID_MOXA_CP168EL_A)
> + return true;
> +
> + return false;
Hmm... First of all, can this be done by using pci_is_pcie()?
Second, if the above is not sufficient, this can be read from driver data, no?
> +}
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-06-08 9:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 11:43 [PATCH 0/6] Adjustments and Enhancements for MOXA PCI Serial Boards Crescent Hsieh
2024-06-07 11:43 ` [PATCH 1/6] tty: serial: 8250: Fix the amount of ports doesn't match the device Crescent Hsieh
2024-06-08 9:58 ` Andy Shevchenko
2024-06-11 7:39 ` Jiri Slaby
2024-06-07 11:43 ` [PATCH 2/6] tty: serial: 8250: Add 2 ports PCI configuration for 921600 BAR 2 Crescent Hsieh
2024-06-07 11:43 ` [PATCH 3/6] tty: mxser: serial: 8250: Relocate device IDs from mxser to 8250_pci Crescent Hsieh
2024-06-11 7:42 ` Jiri Slaby
2024-06-13 10:03 ` Crescent CY Hsieh
2024-06-07 11:43 ` [PATCH 4/6] tty: serial: 8250: Add check for setting default serial interface Crescent Hsieh
2024-06-08 9:57 ` Andy Shevchenko [this message]
2024-06-07 11:43 ` [PATCH 5/6] tty: serial: 8250: Add support for Moxa PCIe boards to switch interface Crescent Hsieh
2024-06-08 9:51 ` Andy Shevchenko
2024-06-07 11:43 ` [PATCH 6/6] tty: serial: 8250: Add support for MUEX50 UART Crescent Hsieh
2024-06-08 9:52 ` Andy Shevchenko
2024-06-08 9:47 ` [PATCH 0/6] Adjustments and Enhancements for MOXA PCI Serial Boards Andy Shevchenko
2024-06-13 10:15 ` Crescent CY Hsieh
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=ZmQrA2_TjgK33uhn@surfacebook.localdomain \
--to=andy.shevchenko@gmail.com \
--cc=crescentcy.hsieh@moxa.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@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