Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753703AbbGRD5j (ORCPT ); Fri, 17 Jul 2015 23:57:39 -0400 Received: from regular1.263xmail.com ([211.150.99.131]:41621 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752232AbbGRD5i (ORCPT ); Fri, 17 Jul 2015 23:57:38 -0400 X-263anti-spam: KSV:0;BIG:0;ABS:1;DNS:0;ATT:S;SPF:S; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ADDR-CHECKED: 0 X-RL-SENDER: zhengxing@rock-chips.com X-FST-TO: broonie@kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: zhengxing@rock-chips.com X-UNIQUE-TAG: <3594514b7b37e1ae1bb908f5fb673654> X-DNS-TYPE: 0 Message-ID: <55A9CD3C.10300@rock-chips.com> Date: Sat, 18 Jul 2015 11:51:24 +0800 From: zhengxing User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 To: Mark Brown CC: dgreid@chromium.org, dianders@chromium.org, heiko@sntech.de, sonnyrao@chromium.org, linux-rockchip@lists.infradead.org, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/2] ASoC: rockchip: Add machine driver for max98090 codec References: <1436930143-31361-1-git-send-email-zhengxing@rock-chips.com> <1436930143-31361-2-git-send-email-zhengxing@rock-chips.com> <20150717180402.GS11162@sirena.org.uk> In-Reply-To: <20150717180402.GS11162@sirena.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1659 Lines: 47 On 2015年07月18日 02:04, Mark Brown wrote: > On Wed, Jul 15, 2015 at 11:15:42AM +0800, Xing Zheng wrote: > > This looks pretty good, a couple of minor points below which should be > quick to fix. > >> +static int rk_init(struct snd_soc_pcm_runtime *runtime) >> +{ >> + struct snd_soc_card *card = runtime->card; >> + >> + card->dapm.idle_bias_off = true; > You shouldn't need to do this? If you do need to do it we should make > it possible to do it from the card struct. Done, we don't need it in the machine driver. >> + ret = snd_soc_register_card(card); >> + if (ret) { >> + pr_err("snd_soc_register_card failed %d\n", ret); >> + return ret; >> + } >> + >> + ret = snd_soc_of_parse_card_name(card, "rockchip,model"); >> + if (ret) >> + return ret; > This should be devm_snd_soc_register_card() and you need to parse the > card name before registering it, otherwise the card might instantiate > before the name is set. Done. >> +static int snd_rk_mc_remove(struct platform_device *pdev) >> +{ >> + struct snd_soc_card *soc_card = platform_get_drvdata(pdev); >> + >> + snd_soc_card_set_drvdata(soc_card, NULL); >> + snd_soc_unregister_card(soc_card); >> + platform_set_drvdata(pdev, NULL); > No need for any of the _set_drvdata() calls, the core does them and they > shouldn't make any difference anyway. Done. I will remove *_set_drvdata and *get_drvdata because we don't need them any more. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/