From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752631AbcBWOEI (ORCPT ); Tue, 23 Feb 2016 09:04:08 -0500 Received: from smtp-out-245.synserver.de ([212.40.185.245]:1143 "EHLO smtp-out-245.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbcBWOEH (ORCPT ); Tue, 23 Feb 2016 09:04:07 -0500 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 5040 Subject: Re: [PATCH v2] ASoC: wm9713: fix regmap free path To: Charles Keepax , Robert Jarzmik References: <1456180544-29108-1-git-send-email-robert.jarzmik@free.fr> <20160223140002.GE1490@localhost.localdomain> Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org From: Lars-Peter Clausen Message-ID: <56CC66D1.7010702@metafoo.de> Date: Tue, 23 Feb 2016 15:04:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160223140002.GE1490@localhost.localdomain> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/23/2016 03:00 PM, Charles Keepax wrote: > On Mon, Feb 22, 2016 at 11:35:44PM +0100, Robert Jarzmik wrote: >> In the conversion to regmap, I assumed that the devm_() variant could be >> used in the soc probe function. >> >> As a mater of fact with the current code the regmap is freed twice >> because of the devm_() call: >> (mutex_lock) from [] (debugfs_remove_recursive+0x50/0x1d0) >> (debugfs_remove_recursive) from [] (regmap_debugfs_exit+0x1c/0xd4) >> (regmap_debugfs_exit) from [] (regmap_exit+0x28/0xc8) >> (regmap_exit) from [] (release_nodes+0x18c/0x204) >> (release_nodes) from [] (device_release+0x18/0x90) >> (device_release) from [] (kobject_release+0x90/0x1bc) >> (kobject_release) from [] (wm9713_soc_remove+0x1c/0x24) >> (wm9713_soc_remove) from [] (soc_remove_component+0x50/0x7c) >> (soc_remove_component) from [] (soc_remove_dai_links+0x118/0x228) >> (soc_remove_dai_links) from [] (snd_soc_register_card+0x4e4/0xdd4) >> (snd_soc_register_card) from [] (devm_snd_soc_register_card+0x34/0x70) >> >> Fix this by replacing the devm_regmap initialization code with the non >> devm_() variant. >> >> Fixes: 700dadfefc3d ASoC: wm9713: convert to regmap >> Cc: Lars-Peter Clausen >> Signed-off-by: Robert Jarzmik >> --- > > Acked-by: Charles Keepax > > I am totally happy for this patch to be merged but would it not > be prefferable to do the regmap init in the device probe and > still use the devm_ call? Doing the regmap setup in the ASoC > probe is a little unusual and I don't really see any reason why > it is necessary here. Unless I am missing something? It's AC97... there is just no proper device model integration for AC97 at the moment.