From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relmlor1.renesas.com ([210.160.252.171]:65517 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932182AbcGDAUg (ORCPT ); Sun, 3 Jul 2016 20:20:36 -0400 Message-ID: <871t3a1crg.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , Subject: Re: [PATCH 07/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name() In-Reply-To: <874m861dzi.wl%kuninori.morimoto.gx@renesas.com> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> <8760tusj2q.wl%kuninori.morimoto.gx@renesas.com> <20160629181555.GJ6247@sirena.org.uk> <874m8bbdei.wl%kuninori.morimoto.gx@renesas.com> <20160701095249.GJ6247@sirena.org.uk> <874m861dzi.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Date: Mon, 4 Jul 2016 00:20:29 +0000 Sender: linux-renesas-soc-owner@vger.kernel.org List-ID: Hi Mark, again sorry previous was not good question > > > > > + if (!card->name) > > > > > + card->name = card->dai_link->name; > > > > > > This will unconditionally defererence dai_link but it's optional - we > > > > can have analogue only cards. > > > > > This is not new feature. Current simple-card already has it. > > > > Right, but simple-card does need DAIs IIRC while this is intended to be > > more general. All it needs is a check before the dereference to be safe > > so it's trivial to handle. > > Sorry, I'm not 100% understand. > Do you mean we don't need handle card->name ? (= we should remove above ?) > If so, we can't register card on simple-card. Because snd_soc_register_card() > requests it. This function tries to get card name from snd_soc_of_parse_card_name(). and it tries to set card->name from dai_link if card still doesn't have name. So, above is optional 2nd try. Or, do you mean this if (!card->name) can goes to simple-card, instead of utils ? I have no objection about it , but it can be double handling ? Because other simple family have same situation. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: Re: [PATCH 07/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name() Date: Mon, 4 Jul 2016 00:20:29 +0000 Message-ID: <871t3a1crg.wl%kuninori.morimoto.gx@renesas.com> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> <8760tusj2q.wl%kuninori.morimoto.gx@renesas.com> <20160629181555.GJ6247@sirena.org.uk> <874m8bbdei.wl%kuninori.morimoto.gx@renesas.com> <20160701095249.GJ6247@sirena.org.uk> <874m861dzi.wl%kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: <874m861dzi.wl%kuninori.morimoto.gx@renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org To: Mark Brown Cc: Linux-ALSA , Liam Girdwood , Simon , linux-renesas-soc@vger.kernel.org List-Id: alsa-devel@alsa-project.org Hi Mark, again sorry previous was not good question > > > > > + if (!card->name) > > > > > + card->name = card->dai_link->name; > > > > > > This will unconditionally defererence dai_link but it's optional - we > > > > can have analogue only cards. > > > > > This is not new feature. Current simple-card already has it. > > > > Right, but simple-card does need DAIs IIRC while this is intended to be > > more general. All it needs is a check before the dereference to be safe > > so it's trivial to handle. > > Sorry, I'm not 100% understand. > Do you mean we don't need handle card->name ? (= we should remove above ?) > If so, we can't register card on simple-card. Because snd_soc_register_card() > requests it. This function tries to get card name from snd_soc_of_parse_card_name(). and it tries to set card->name from dai_link if card still doesn't have name. So, above is optional 2nd try. Or, do you mean this if (!card->name) can goes to simple-card, instead of utils ? I have no objection about it , but it can be double handling ? Because other simple family have same situation.