Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1433915yba; Wed, 24 Apr 2019 22:53:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdrTPOGVZQ94H4j+sTkSZdyGScHikvk6LMu+8ndlzM1T5ykjLHS5aKAHXAJh9DyuptSZvp X-Received: by 2002:a62:4602:: with SMTP id t2mr37964930pfa.26.1556171627904; Wed, 24 Apr 2019 22:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556171627; cv=none; d=google.com; s=arc-20160816; b=HNQwiC/qMH6CKfANG2JZdw46yovisAKOFCHxv+8Bk1fPKPIyVuAI1aLTKEWSVRMxQv mdyZYoiVmGQCQRzCdCU7M1Ay6eTMCvBO1dSAkFuXPjLaqapICyiY6l9PLgRB5UG9TH+a szrJ2EaYIsxcODll/Mdb1hkfx6RnafKhkz3iH3b0+ZMIDntpCpwp7OVDo3zui/keiGAC a6xhNrnjSH8Cwl8Wr5A5I8YsTuDdN3DPR60Ra07F4Roj2/1irrPf1NY+vARq2Vs5kRKo BMXjudXEJ5u/7xe29EFK/aKRfGMlk/S/+CCWXRl7l1dahqFUseZu/U7bU4wS/coqIlvm eILA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date; bh=AhoVzfy5BkbFtympPV3g9krMCjezYoGPScP/7B9u6qc=; b=l5XYia4tpcm9+ke4mpkWVbwUxtTqS40tgO2lHKt4qr0jzqnKFbdEunXXqv4CZb4Ayx JU7eH3zWmWEe49YwDAdlid4DFG8nxXkNbjToKvfcaZuM1Ee79xnarMiAvmUvq31+Ueg6 GIja0juZhOQB85Lzzd5A4UUdAcqJPbn8qZlgFWp7RkKixYxt7hz5Dg2mWSvwSgmoQHIC 444v3yH10ODYOTNIUefAgBDagWLadFTYfTy3PS11Sj/AB0429rgOgk1iYKlnuHPz5vbv sYUDwRouJ7GUYlnoaqWEzBLxYIIGMCCXkYwpQpG8FAYgjTbsvByqFHG/wqTSJJ1kH0mH K2uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si11336205pgh.0.2019.04.24.22.53.32; Wed, 24 Apr 2019 22:53:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388053AbfDXSus (ORCPT + 99 others); Wed, 24 Apr 2019 14:50:48 -0400 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:36647 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfDXSuq (ORCPT ); Wed, 24 Apr 2019 14:50:46 -0400 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id 70EC63C00D1; Wed, 24 Apr 2019 20:50:42 +0200 (CEST) Received: from smtp1.de.adit-jv.com ([127.0.0.1]) by localhost (smtp1.de.adit-jv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v_zvJA-lUgeK; Wed, 24 Apr 2019 20:50:35 +0200 (CEST) Received: from HI2EXCH01.adit-jv.com (hi2exch01.adit-jv.com [10.72.92.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id A23BD3C0034; Wed, 24 Apr 2019 20:50:35 +0200 (CEST) Received: from vmlxhi-102.adit-jv.com (10.72.93.184) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 20:50:35 +0200 Date: Wed, 24 Apr 2019 20:50:32 +0200 From: Eugeniu Rosca To: Christian Gromm CC: Greg Kroah-Hartman , Andrey Shvetsov , , , Suresh Udipi , Eugeniu Rosca , Eugeniu Rosca Subject: Re: [PATCH 16/28] staging: most: sound: call snd_card_new with struct device Message-ID: <20190424185032.GA9019@vmlxhi-102.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180609182902.A31D621C28@pdx-korg-gitolite-1.ci.codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.72.93.184] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christian, On Tue, 08 May 2018 02:46:44 -0700, Christian Gromm wrote: > 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 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; Just for your information, when mapping commits from vanilla to those from https://github.com/microchip-ais/linux/commits/mld-1.8.0, we've stumbled upon some subtle but striking difference between mld-1.8.0 commit [0] and v4.18-rc1 commit [1]. The latter looks like an upstreamed version of the former. However, while commit [0] creates a new 'dev' member in 'struct most_interface' and uses it consistently, commit [1] creates 'driver_dev' and uses it intermixed with 'dev'. Since we don't use aim-sound, we just signal this feedback to you as FWIW without sending a patch (which we can't test). [0] https://github.com/microchip-ais/linux/commit/2fef0f89f04703 ("staging: most: add struct device to most interface") [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=69c90cf1b2faf5 ("staging: most: sound: call snd_card_new with struct device") -- Best regards, Eugeniu.