Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbbGSHsY (ORCPT ); Sun, 19 Jul 2015 03:48:24 -0400 Received: from regular1.263xmail.com ([211.150.99.131]:37279 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751230AbbGSHsW (ORCPT ); Sun, 19 Jul 2015 03:48:22 -0400 X-Greylist: delayed 95596 seconds by postgrey-1.27 at vger.kernel.org; Sun, 19 Jul 2015 03:48:21 EDT X-263anti-spam: KSV:0;BIG:0;ABS:1;DNS:0;ATT:0;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: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <55AB54CF.20609@rock-chips.com> Date: Sun, 19 Jul 2015 15:42:07 +0800 From: Xing Zheng 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, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH v2 1/2] ASoC: rockchip: Add machine driver for max98090 codec References: <1437196124-32655-1-git-send-email-zhengxing@rock-chips.com> <1437196124-32655-2-git-send-email-zhengxing@rock-chips.com> <20150718091608.GW11162@sirena.org.uk> In-Reply-To: <20150718091608.GW11162@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: 905 Lines: 27 On 2015年07月18日 17:16, Mark Brown wrote: > On Sat, Jul 18, 2015 at 01:08:43PM +0800, Xing Zheng wrote: > >> + ret = devm_snd_soc_register_card(&pdev->dev, card); >> + if (ret) { >> + dev_err(&pdev->dev, >> + "Soc register card failed %d\n", ret); >> + return ret; >> + } >> + >> + return ret; >> +} >> + >> +static int snd_rk_mc_remove(struct platform_device *pdev) >> +{ >> + struct snd_soc_card *soc_card = platform_get_drvdata(pdev); >> + >> + snd_soc_unregister_card(soc_card); > The point with using devm_snd_soc_register_card() is that you don't need > to manually unregister the card - devm_ ensures that the card is freed. Got it. Thank you. -- 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/