On Wed, Apr 09, 2014 at 09:21:06AM -0600, Shuah Khan wrote:
Test Cases for token devres interfaces: (passed)
- Create, lock, unlock, and destroy sequence.
- Try lock while it is locked. Returns -EBUSY as expected.
- Try lock after destroy. Returns -ENODEV as expected.
- Unlock while it is unlocked. Returns 0 as expected. This is a no-op.
- Try unlock after destroy. Returns -ENODEV as expected.
Any chance you can add these "test cases" as part of the kernel code so
it lives here for any future changes?
Special notes for Mauro Chehab:
- Please evaluate if these token devres interfaces cover all media driver
use-cases. If not what is needed to cover them.
- For use-case testing, I generated a string from em28xx device, as this
is common for all em28xx extensions: (hope this holds true when em28xx
uses snd-usb-audio
- Construct string with (dev is struct em28xx *dev)
format: "tuner:%s-%s-%d"
with the following:
dev_name(&dev->udev->dev)
dev->udev->bus->bus_name
dev->tuner_addr
- I added test code to em28xx_card_setup() to test the interfaces:
example token from this test code generated with the format above:
What would the driver changes look like to take advantage of these new
functions?