mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
virtio: enhance id_matching for virtio drivers
This patch allows a virtio driver to use VIRTIO_DEV_ANY_ID for the device id. This will be used by a test module that can be bound to any virtio device. Signed-off-by: Christian Borntraeger <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
parent
c89e80168b
commit
e335385373
2 changed files with 2 additions and 2 deletions
|
|
@ -58,7 +58,7 @@ static struct device_attribute virtio_dev_attrs[] = {
|
|||
static inline int virtio_id_match(const struct virtio_device *dev,
|
||||
const struct virtio_device_id *id)
|
||||
{
|
||||
if (id->device != dev->id.device)
|
||||
if (id->device != dev->id.device && id->device != VIRTIO_DEV_ANY_ID)
|
||||
return 0;
|
||||
|
||||
return id->vendor == VIRTIO_DEV_ANY_ID || id->vendor == dev->id.vendor;
|
||||
|
|
|
|||
Loading…
Reference in a new issue