summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2023-07-02 01:17:57 +0200
committerBastien Nocera <hadess@hadess.net>2023-07-03 16:07:46 +0200
commit3487e804af160e2157e94b8f62ca70a8745c12a9 (patch)
treea009b6d6c44cc513b68503235c28a5d6a2e1d56d
parent5656939590b6196f2a3807a29bb81b273cec3951 (diff)
linux: Add debug to audio sub-type detection
-rw-r--r--src/linux/up-device-supply.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
index 83c29f2..edf6548 100644
--- a/src/linux/up-device-supply.c
+++ b/src/linux/up-device-supply.c
@@ -425,7 +425,8 @@ up_device_supply_sibling_discovered (UpDevice *device,
/* Match audio sub-type */
if (new_type == UP_DEVICE_KIND_OTHER_AUDIO) {
const char *form_factor = g_udev_device_get_property (input, "SOUND_FORM_FACTOR");
- for (i = 0; i < G_N_ELEMENTS (sound_types); i++) {
+ g_debug ("Guessing audio sub-type from SOUND_FORM_FACTOR='%s'", form_factor);
+ for (i = 0; form_factor != NULL && i < G_N_ELEMENTS (sound_types); i++) {
if (g_strcmp0 (form_factor, sound_types[i].form_factor) == 0) {
new_type = sound_types[i].kind;
break;