aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2018-05-08 11:45:04 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-08 13:41:50 +0200
commit69c90cf1b2faf5fa08fe5e18e4b47b044474506e (patch)
tree250f839a14daaaf7da99e47a016ecb12a94181f5
parentstaging: most: make interface drivers allocate coherent memory (diff)
downloadlinux-dev-69c90cf1b2faf5fa08fe5e18e4b47b044474506e.tar.xz
linux-dev-69c90cf1b2faf5fa08fe5e18e4b47b044474506e.zip
staging: most: sound: call snd_card_new with struct device
This patch is needed as function snd_card_new needs a valid parent device. Passing a NULL pointer leads to kernel Ooops. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/most/core.h1
-rw-r--r--drivers/staging/most/sound/sound.c2
-rw-r--r--drivers/staging/most/usb/usb.c1
3 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/most/core.h b/drivers/staging/most/core.h
index 7a3c70bead19..64cc02f161e7 100644
--- a/drivers/staging/most/core.h
+++ b/drivers/staging/most/core.h
@@ -230,6 +230,7 @@ struct mbo {
*/
struct most_interface {
struct device dev;
+ struct device *driver_dev;
struct module *mod;
enum most_interface_type interface;
const char *description;
diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c
index 18f722410a63..04c18323c2ea 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -590,7 +590,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
if (ret < 0)
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/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index 5ed1dccc0839..f18726049528 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -1043,6 +1043,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
mdev->link_stat_timer.expires = jiffies + (2 * HZ);
mdev->iface.mod = hdm_usb_fops.owner;
+ mdev->iface.driver_dev = &interface->dev;
mdev->iface.interface = ITYPE_USB;
mdev->iface.configure = hdm_configure_channel;
mdev->iface.request_netinfo = hdm_request_netinfo;