mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
virtio: allow drivers to validate features
Some drivers can't support all features in all configurations. At the moment we blindly set FEATURES_OK and later FAILED. Support this better by adding a callback drivers can use to do some early checks. Signed-off-by: Michael S. Tsirkin <[email protected]>
This commit is contained in:
parent
2e123b44a3
commit
404123c2db
2 changed files with 7 additions and 0 deletions
|
|
@ -232,6 +232,12 @@ static int virtio_dev_probe(struct device *_d)
|
|||
if (device_features & (1ULL << i))
|
||||
__virtio_set_bit(dev, i);
|
||||
|
||||
if (drv->validate) {
|
||||
err = drv->validate(dev);
|
||||
if (err)
|
||||
goto err;
|
||||
}
|
||||
|
||||
err = virtio_finalize_features(dev);
|
||||
if (err)
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue