From c4a379b4d3058b153832991ba1a1d697cad06600 Mon Sep 17 00:00:00 2001 From: Christian Gromm Date: Fri, 1 Sep 2017 13:53:32 +0200 Subject: [PATCH 2/5] most: pass parent devcie to snd_card_new Signed-off-by: Christian Gromm --- driver/aim-sound/sound.c | 2 +- driver/hdm-usb/hdm_usb.c | 1 + driver/include/mostcore.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aim-sound/sound.c b/aim-sound/sound.c index e4198e5..a2ccc79 100644 --- a/aim-sound/sound.c +++ b/aim-sound/sound.c @@ -595,7 +595,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id, return ret; } - ret = snd_card_new(NULL, -1, card_name, THIS_MODULE, + ret = snd_card_new(iface->dev, -1, card_name, THIS_MODULE, sizeof(*channel), &card); if (ret < 0) return ret; diff --git a/hdm-usb/hdm_usb.c b/hdm-usb/hdm_usb.c index 0b689b5..0937496 100644 --- a/hdm-usb/hdm_usb.c +++ b/hdm-usb/hdm_usb.c @@ -1160,6 +1160,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) mdev->iface.dma_free = hdm_dma_free; mdev->iface.description = mdev->description; mdev->iface.num_channels = num_endpoints; + mdev->iface.dev = &interface->dev; snprintf(mdev->description, sizeof(mdev->description), "usb_device %d-%s:%d.%d", diff --git a/include/mostcore.h b/include/mostcore.h index deefe25..d3523a9 100644 --- a/include/mostcore.h +++ b/include/mostcore.h @@ -237,6 +237,7 @@ struct mbo { */ struct most_interface { struct module *mod; + struct device *dev; enum most_interface_type interface; const char *description; int num_channels; -- 2.7.4