From patchwork Wed Nov 24 07:23:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 351881 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAO7IbJt003177 for ; Wed, 24 Nov 2010 07:18:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751056Ab0KXHSM (ORCPT ); Wed, 24 Nov 2010 02:18:12 -0500 Received: from mail-yw0-f46.google.com ([209.85.213.46]:42611 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913Ab0KXHSM (ORCPT ); Wed, 24 Nov 2010 02:18:12 -0500 Received: by ywl5 with SMTP id 5so915706ywl.19 for ; Tue, 23 Nov 2010 23:18:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=8AHbA2JhyJvWUk1SZViLdazNZpQg+wLde9mQnKsunuY=; b=lSfN/u+u+dajk2Rl4Y4MSIrTiqeC8fr5A7NIfiedBv4zB45JunC5/THRLPicuvGuIz JxHjUz35g5xpKBFJaXCh7fAi3kfuXU5V28uzgkGslfyhumjX3FB+W43Juz7eWqChUIvo pW9SHeXFkGsFRHtqczZkjkdXx6XKALn1vstoU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=SNTF61dznQ92ANQwXxkB5pX1TRNF46TbvM/OVxRLcQgKEVLzxBBMGJGiGfnXKg1XKE CodEkJTicBkwHpZZkJFbCkuFIjYgwAvLOIXF9p7bRjNTw1C8FUnLzdW+HZQLWjdgz4Oh z4LDjPLhAFBqAmXpBh5PLXDj1uVAcbge5jQOg= Received: by 10.100.10.15 with SMTP id 15mr5868641anj.23.1290583090862; Tue, 23 Nov 2010 23:18:10 -0800 (PST) Received: from [192.168.100.50] (60-251-136-127.HINET-IP.hinet.net [60.251.136.127]) by mx.google.com with ESMTPS id 37sm103839anr.4.2010.11.23.23.18.07 (version=SSLv3 cipher=RC4-MD5); Tue, 23 Nov 2010 23:18:10 -0800 (PST) Subject: [PATCH 2/2] ASoC: Fix resource reclaim for osk5912 From: Axel Lin To: linux-kernel Cc: Arun KS , Jarkko Nikula , Liam Girdwood , Mark Brown , linux-omap@vger.kernel.org In-Reply-To: <1290583248.20639.1.camel@mola> References: <1290583248.20639.1.camel@mola> Date: Wed, 24 Nov 2010 15:23:20 +0800 Message-Id: <1290583400.20639.3.camel@mola> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 24 Nov 2010 07:18:58 +0000 (UTC) diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c index 18d053d..7e75e77 100644 --- a/sound/soc/omap/osk5912.c +++ b/sound/soc/omap/osk5912.c @@ -177,7 +177,8 @@ static int __init osk_soc_init(void) tlv320aic23_mclk = clk_get(dev, "mclk"); if (IS_ERR(tlv320aic23_mclk)) { printk(KERN_ERR "Could not get mclk clock\n"); - return -ENODEV; + err = PTR_ERR(tlv320aic23_mclk); + goto err2; } /* @@ -188,7 +189,7 @@ static int __init osk_soc_init(void) if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) { printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n"); err = -ECANCELED; - goto err1; + goto err3; } } @@ -196,9 +197,12 @@ static int __init osk_soc_init(void) (uint) clk_get_rate(tlv320aic23_mclk), CODEC_CLOCK); return 0; -err1: + +err3: clk_put(tlv320aic23_mclk); +err2: platform_device_del(osk_snd_device); +err1: platform_device_put(osk_snd_device); return err; @@ -207,6 +211,7 @@ err1: static void __exit osk_soc_exit(void) { + clk_put(tlv320aic23_mclk); platform_device_unregister(osk_snd_device); }