From: Uwe Kleine-König Date: Tue, 12 Oct 2021 21:05:47 +0000 (-0500) Subject: x86/pci/probe_roms: Use to_pci_driver() instead of pci_dev->driver X-Git-Tag: xarray-5.18~644^2~23^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d98d53331b727838122bc80e1898c4e1fc201fb0;p=users%2Fwilly%2Fxarray.git x86/pci/probe_roms: Use to_pci_driver() instead of pci_dev->driver Struct pci_driver contains a struct device_driver, so for PCI devices, it's easy to convert a device_driver * to a pci_driver * with to_pci_driver(). The device_driver * is in struct device, so we don't need to also keep track of the pci_driver * in struct pci_dev. Replace pdev->driver with to_pci_driver(). This is a step toward removing pci_dev->driver. [bhelgaas: split to separate patch] Link: https://lore.kernel.org/r/20211004125935.2300113-11-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Bjorn Helgaas --- diff --git a/arch/x86/kernel/probe_roms.c b/arch/x86/kernel/probe_roms.c index 9e1def3744f2..36e84d904260 100644 --- a/arch/x86/kernel/probe_roms.c +++ b/arch/x86/kernel/probe_roms.c @@ -80,7 +80,7 @@ static struct resource video_rom_resource = { */ static bool match_id(struct pci_dev *pdev, unsigned short vendor, unsigned short device) { - struct pci_driver *drv = pdev->driver; + struct pci_driver *drv = to_pci_driver(pdev->dev.driver); const struct pci_device_id *id; if (pdev->vendor == vendor && pdev->device == device)