Re: [PATCH 1/4] tty: serial: 8250: Cleanup MOXA configurations in 8250_pci.c

From: Greg KH
Date: Tue Oct 03 2023 - 03:30:16 EST


On Tue, Oct 03, 2023 at 03:17:47PM +0800, Crescent CY Hsieh wrote:
> On Mon, Oct 02, 2023 at 08:51:03AM +0200, Jiri Slaby wrote:
> > On 02. 10. 23, 3:56, Crescent CY Hsieh wrote:
> > > @@ -1958,6 +1958,9 @@ pci_moxa_setup(struct serial_private *priv,
> > > #define PCIE_DEVICE_ID_WCH_CH384_8S 0x3853
> > > #define PCIE_DEVICE_ID_WCH_CH382_2S 0x3253
> > > +/* MOXA */
> > > +#define PCI_VENDOR_ID_MOXA 0x1393
> >
> > Isn't this a redefinition of the pci-ids.h one?
>
> At first, I attempt to place DEVICE_ID macros into pci_ids.h to enable
> their usage throughout 8250_pci.c and to establish centralized
> management. However, I notice the comment in pci_ids.h which is:
>
> 'Do not add new entries to this file unless the definitions are shared
> between multiple drivers'
>
> So I add this VENDOR_ID just for the clarity, even though it results in
> duplication.
>
> Should I put these macros into pci_ids.h? If so, I am willing to help
> relocate all other macros.

Please do not add new defines to pci_ids.h unless they are needed in
multiple files.

thanks,

greg k-h