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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: topology: Replace fake root_device with kunit_device in tests

Using struct root_device to create fake devices for tests is something
of a hack. The new struct kunit_device is meant for this purpose, so use
it instead.

Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

davidgow@google.com and committed by
Shuah Khan
e57cdff0 83701838

+2 -8
+2 -8
sound/soc/soc-topology-test.c
··· 9 9 #include <sound/core.h> 10 10 #include <sound/soc.h> 11 11 #include <sound/soc-topology.h> 12 + #include <kunit/device.h> 12 13 #include <kunit/test.h> 13 14 14 15 /* ===== HELPER FUNCTIONS =================================================== */ ··· 22 21 */ 23 22 static struct device *test_dev; 24 23 25 - static struct device_driver test_drv = { 26 - .name = "sound-soc-topology-test-driver", 27 - }; 28 - 29 24 static int snd_soc_tplg_test_init(struct kunit *test) 30 25 { 31 - test_dev = root_device_register("sound-soc-topology-test"); 26 + test_dev = kunit_device_register(test, "sound-soc-topology-test"); 32 27 test_dev = get_device(test_dev); 33 28 if (!test_dev) 34 29 return -ENODEV; 35 - 36 - test_dev->driver = &test_drv; 37 30 38 31 return 0; 39 32 } ··· 35 40 static void snd_soc_tplg_test_exit(struct kunit *test) 36 41 { 37 42 put_device(test_dev); 38 - root_device_unregister(test_dev); 39 43 } 40 44 41 45 /*