Skip to content
Commit bbf9d313 authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Takashi Iwai
Browse files

ALSA: hda/cirrus_scodec_test: Modernize creation of dummy devices



Replace the old direct use of platform_device APIs with newer KUnit APIs
and the faux bus.

The dummy codec driver device doesn't need to be a platform device.
It can be a faux bus device.

The dummy GPIO driver still must be a platform_device so that a
software_node can be added to it before it probes. But use the new
KUnit-managed APIs to create the platform_device and platform_driver.
These will cleanup automatically when a test completes or fails.

Also use KUnit resource cleanup to destroy the faux bus driver and the GPIO
software node instead of doing this "manually" in test exit() functions.

Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250415105414.471039-1-rf@opensource.cirrus.com


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent fd7f3432
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment