Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

uwb: Use dev_is_pci() to check whether it is pci device

Use PCI standard marco dev_is_pci() instead of directly compare
pci_bus_type to check whether it is pci device.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Yijing Wang and committed by
Greg Kroah-Hartman
0d4e5bee 1ae5799e

+2 -2
+1 -1
drivers/uwb/umc-bus.c
··· 85 85 const struct pci_device_id *id_table = umc_drv->match_data; 86 86 struct pci_dev *pci; 87 87 88 - if (umc->dev.parent->bus != &pci_bus_type) 88 + if (!dev_is_pci(umc->dev.parent)) 89 89 return 0; 90 90 91 91 pci = to_pci_dev(umc->dev.parent);
+1 -1
include/linux/uwb/umc.h
··· 143 143 static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) 144 144 { 145 145 struct pci_dev *pci_dev = NULL; 146 - if (umc_dev->dev.parent->bus == &pci_bus_type) 146 + if (dev_is_pci(umc_dev->dev.parent)) 147 147 pci_dev = to_pci_dev(umc_dev->dev.parent); 148 148 return pci_dev; 149 149 }