2e341dd948f7ebb3051f36a22c2c0d70fc83ef42
[AGL/meta-agl-demo.git] / recipes-kernel / most / files / 0002-most-pass-parent-devcie-to-snd_card_new.patch
1 From c4a379b4d3058b153832991ba1a1d697cad06600 Mon Sep 17 00:00:00 2001
2 From: Christian Gromm <christian.gromm@microchip.com>
3 Date: Fri, 1 Sep 2017 13:53:32 +0200
4 Subject: [PATCH 2/5] most: pass parent devcie to snd_card_new
5
6 Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
7 ---
8  driver/aim-sound/sound.c  | 2 +-
9  driver/hdm-usb/hdm_usb.c  | 1 +
10  driver/include/mostcore.h | 1 +
11  3 files changed, 3 insertions(+), 1 deletion(-)
12
13 diff --git a/aim-sound/sound.c b/aim-sound/sound.c
14 index e4198e5..a2ccc79 100644
15 --- a/aim-sound/sound.c
16 +++ b/aim-sound/sound.c
17 @@ -595,7 +595,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
18                 return ret;
19         }
20  
21 -       ret = snd_card_new(NULL, -1, card_name, THIS_MODULE,
22 +       ret = snd_card_new(iface->dev, -1, card_name, THIS_MODULE,
23                            sizeof(*channel), &card);
24         if (ret < 0)
25                 return ret;
26 diff --git a/hdm-usb/hdm_usb.c b/hdm-usb/hdm_usb.c
27 index 0b689b5..0937496 100644
28 --- a/hdm-usb/hdm_usb.c
29 +++ b/hdm-usb/hdm_usb.c
30 @@ -1160,6 +1160,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
31         mdev->iface.dma_free = hdm_dma_free;
32         mdev->iface.description = mdev->description;
33         mdev->iface.num_channels = num_endpoints;
34 +       mdev->iface.dev = &interface->dev;
35  
36         snprintf(mdev->description, sizeof(mdev->description),
37                  "usb_device %d-%s:%d.%d",
38 diff --git a/include/mostcore.h b/include/mostcore.h
39 index deefe25..d3523a9 100644
40 --- a/include/mostcore.h
41 +++ b/include/mostcore.h
42 @@ -237,6 +237,7 @@ struct mbo {
43   */
44  struct most_interface {
45         struct module *mod;
46 +       struct device *dev;
47         enum most_interface_type interface;
48         const char *description;
49         int num_channels;
50 -- 
51 2.7.4
52