Re: [PATCH 01/15] serial: 8250: split Moxa PCIe serial board support out of 8250_pci
From: Andy Shevchenko
Date: Tue May 19 2026 - 03:58:13 EST
On Mon, May 18, 2026 at 3:53 PM Crescent Hsieh
<crescentcy.hsieh@xxxxxxxx> wrote:
> On Mon, May 04, 2026 at 04:27:44PM +0300, Andy Shevchenko wrote:
> > On Mon, May 4, 2026 at 11:49 AM Crescent Hsieh
> > <crescentcy.hsieh@xxxxxxxx> wrote:
> > > +static void mxpcie8250_remove(struct pci_dev *pdev)
> > > +{
> > > + struct mxpcie8250 *priv = dev_get_drvdata(&pdev->dev);
> >
> > platform_get_drvdata() IIRC
>
> In a previous patchset, dev_get_drvdata() was suggested for similar
> cases [1].
The case is not similar, while looking familiar. Here we have a PCI
device already given as a parameter (sorry, I mixed it with platform
in my previous reply), and there the uart_port, from which you take
device, convert to PCI and use pci_get_drvdata(). There it's a detour
as one may use dev_get_drvdata(port->dev) without PCI being involved.
> Since 8250_mxpcie is a PCI driver, could you clarify what you would
> prefer here for retrieving the private data? I was not sure whether the
> intention was to use dev_get_drvdata(), pci_get_drvdata(), or something
> else, since platform_get_drvdata() does not seem to match this driver
> type.
pci_get_drvdata().
> [1]
> https://lore.kernel.org/all/CAHp75VcPanVWaLi39Wf-pq8nA+xbeJUs=v1BACz-+Sns0BVyWg@xxxxxxxxxxxxxx/
--
With Best Regards,
Andy Shevchenko