Commit 69c90cf1 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

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: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3598cec5
...@@ -230,6 +230,7 @@ struct mbo { ...@@ -230,6 +230,7 @@ struct mbo {
*/ */
struct most_interface { struct most_interface {
struct device dev; struct device dev;
struct device *driver_dev;
struct module *mod; struct module *mod;
enum most_interface_type interface; enum most_interface_type interface;
const char *description; const char *description;
......
...@@ -590,7 +590,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id, ...@@ -590,7 +590,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
if (ret < 0) if (ret < 0)
return ret; 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); sizeof(*channel), &card);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -1043,6 +1043,7 @@ hdm_probe(struct usb_interface *interface, const struct usb_device_id *id) ...@@ -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->link_stat_timer.expires = jiffies + (2 * HZ);
mdev->iface.mod = hdm_usb_fops.owner; mdev->iface.mod = hdm_usb_fops.owner;
mdev->iface.driver_dev = &interface->dev;
mdev->iface.interface = ITYPE_USB; mdev->iface.interface = ITYPE_USB;
mdev->iface.configure = hdm_configure_channel; mdev->iface.configure = hdm_configure_channel;
mdev->iface.request_netinfo = hdm_request_netinfo; mdev->iface.request_netinfo = hdm_request_netinfo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment