mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
device: Implement a bus agnostic dev_num_vf routine
Now that pci_bus_type has num_vf callback set, dev_num_vf can be implemented in a bus type independent way and the check for whether a PCI device is being handled in rtnetlink can be dropped. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
02e0bea6c8
commit
9af15c3825
3 changed files with 8 additions and 4 deletions
|
@ -1144,6 +1144,13 @@ extern int device_online(struct device *dev);
|
|||
extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
|
||||
extern void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
|
||||
|
||||
static inline int dev_num_vf(struct device *dev)
|
||||
{
|
||||
if (dev->bus && dev->bus->num_vf)
|
||||
return dev->bus->num_vf(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Root device objects for grouping under /sys/devices
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue