[PATCH v1 4/5] PCI: Adapt all code locations to not use struct pci_dev::driver directly
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Sat Jul 31 22:08:36 AEST 2021
Hello Boris,
On Fri, Jul 30, 2021 at 04:37:31PM -0400, Boris Ostrovsky wrote:
> On 7/29/21 4:37 PM, Uwe Kleine-König wrote:
> > --- a/drivers/pci/xen-pcifront.c
> > +++ b/drivers/pci/xen-pcifront.c
> > @@ -599,12 +599,12 @@ static pci_ers_result_t pcifront_common_process(int cmd,
> > result = PCI_ERS_RESULT_NONE;
> >
> > pcidev = pci_get_domain_bus_and_slot(domain, bus, devfn);
> > - if (!pcidev || !pcidev->driver) {
> > + pdrv = pci_driver_of_dev(pcidev);
> > + if (!pcidev || !pdrv) {
>
> If pcidev is NULL we are dead by the time we reach 'if' statement.
Oh, you're right. So this needs something like:
if (!pcidev || !(pdrv = pci_driver_of_dev(pcidev)))
or repeating the call to pci_driver_of_dev for each previous usage of
pdev->driver.
If there are no other preferences I'd got with the first approach for
v2.
Best regards and thanks for catching,
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20210731/292c4140/attachment-0001.sig>
More information about the Linuxppc-dev
mailing list