mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
powerpc/eeh: Use dev_driver_string() instead of struct pci_dev->driver->name
Replace pdev->driver->name by dev_driver_string() for the corresponding struct device. This is a step toward removing pci_dev->driver. Move the function nearer its only user and instead of the ?: operator use a normal "if" which is more readable. Link: https://lore.kernel.org/r/20211004125935.2300113-6-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
7c3b2c933a
commit
5a72431ec3
2 changed files with 8 additions and 5 deletions
|
@ -55,11 +55,6 @@ void eeh_pe_dev_mode_mark(struct eeh_pe *pe, int mode);
|
|||
void eeh_sysfs_add_device(struct pci_dev *pdev);
|
||||
void eeh_sysfs_remove_device(struct pci_dev *pdev);
|
||||
|
||||
static inline const char *eeh_driver_name(struct pci_dev *pdev)
|
||||
{
|
||||
return (pdev && pdev->driver) ? pdev->driver->name : "<null>";
|
||||
}
|
||||
|
||||
#endif /* CONFIG_EEH */
|
||||
|
||||
#define PCI_BUSNO(bdfn) ((bdfn >> 8) & 0xff)
|
||||
|
|
|
@ -399,6 +399,14 @@ static int eeh_phb_check_failure(struct eeh_pe *pe)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline const char *eeh_driver_name(struct pci_dev *pdev)
|
||||
{
|
||||
if (pdev)
|
||||
return dev_driver_string(&pdev->dev);
|
||||
|
||||
return "<null>";
|
||||
}
|
||||
|
||||
/**
|
||||
* eeh_dev_check_failure - Check if all 1's data is due to EEH slot freeze
|
||||
* @edev: eeh device
|
||||
|
|
Loading…
Reference in a new issue