From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0676B1CF17B for ; Tue, 8 May 2018 09:46:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9ABD48498C for ; Tue, 8 May 2018 09:46:12 +0000 (UTC) Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2Sbyh458E7Ja for ; Tue, 8 May 2018 09:46:12 +0000 (UTC) Received: from esa6.microchip.iphmx.com (esa6.microchip.iphmx.com [216.71.154.253]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 101D785DF7 for ; Tue, 8 May 2018 09:46:12 +0000 (UTC) From: Christian Gromm Subject: [PATCH 16/28] staging: most: sound: call snd_card_new with struct device Date: Tue, 8 May 2018 11:45:04 +0200 Message-ID: <1525772716-15742-17-git-send-email-christian.gromm@microchip.com> In-Reply-To: <1525772716-15742-1-git-send-email-christian.gromm@microchip.com> References: <1525772716-15742-1-git-send-email-christian.gromm@microchip.com> MIME-Version: 1.0 List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: Christian Gromm , driverdev-devel@linuxdriverproject.org 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 --- drivers/staging/most/core.h | 1 + drivers/staging/most/sound/sound.c | 2 +- drivers/staging/most/usb/usb.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/most/core.h b/drivers/staging/most/core.h index 7a3c70b..64cc02f 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 18f7224..04c1832 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 5ed1dcc..f187260 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; -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel