From patchwork Thu Nov 22 04:08:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13059 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C2B304C178B for ; Thu, 22 Nov 2012 04:15:44 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 515EEA1897E for ; Thu, 22 Nov 2012 04:15:44 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so48424ieb.11 for ; Wed, 21 Nov 2012 20:15:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=0Iw/P4Y2bVb13xJbmjZEtHdFHlWg0C/+ThAjPsUPNNQ=; b=WWQuJHNeRBK+EGKclsheRmJdduFXUG7TLmgjujvI7EQlGpJHqwWTufvrScr3PmHtoT B/culANmX0LbjUj1A4S5+5fiyZhoX5QJP7bUhcGaG+Z95BUjAxQNOMIzw4gBodcenIKb ji0Q6KZdS2zTSXmlpSKY3jy3f9cNSCiRLU4L8LrF49Nf0nF9hIisnTPlAZd1/lb9Subj zJtJZRxD7PEMXwRhr40IySIziQ4LoLLvfz1aKR2HK3Ibct6/Y7ct6dFndsDePu1myuwC WNQ3cuZoHnMJ8fkA3S5gZoqfnA7S7p6OdXXiHJpJJeQCwr+nkp+1mSK+XLBBER6xob2B 9wHA== Received: by 10.50.186.199 with SMTP id fm7mr1746138igc.62.1353557744102; Wed, 21 Nov 2012 20:15:44 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp147934igt; Wed, 21 Nov 2012 20:15:43 -0800 (PST) Received: by 10.68.234.229 with SMTP id uh5mr659018pbc.123.1353557743578; Wed, 21 Nov 2012 20:15:43 -0800 (PST) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id zz3si3348065pbc.271.2012.11.21.20.15.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.48; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pb0-f48.google.com with SMTP id rq13so4843587pbb.7 for ; Wed, 21 Nov 2012 20:15:43 -0800 (PST) Received: by 10.68.248.1 with SMTP id yi1mr741915pbc.93.1353557743357; Wed, 21 Nov 2012 20:15:43 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id s7sm1164602paz.7.2012.11.21.20.15.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:42 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com Cc: broonie@opensource.wolfsonmicro.com, patches@linaro.org Subject: [PATCH 10/10] ASoC: wm8995: Convert to use devm_regmap_init_{spi, i2c}() Date: Thu, 22 Nov 2012 09:38:42 +0530 Message-Id: <1353557322-25353-11-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353557322-25353-1-git-send-email-tushar.behera@linaro.org> References: <1353557322-25353-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQm9vAeHXjxt5S89ElVpACWQqzil+dFc3WZtdVIGWObn25cX25IQFDGjZN5JtOpL2xIuMnbH Signed-off-by: Tushar Behera --- sound/soc/codecs/wm8995.c | 26 +++----------------------- 1 files changed, 3 insertions(+), 23 deletions(-) diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 2eb68c1..f1a7cf1 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c @@ -2267,7 +2267,7 @@ static int __devinit wm8995_spi_probe(struct spi_device *spi) spi_set_drvdata(spi, wm8995); - wm8995->regmap = regmap_init_spi(spi, &wm8995_regmap); + wm8995->regmap = devm_regmap_init_spi(spi, &wm8995_regmap); if (IS_ERR(wm8995->regmap)) { ret = PTR_ERR(wm8995->regmap); dev_err(&spi->dev, "Failed to register regmap: %d\n", ret); @@ -2277,22 +2277,12 @@ static int __devinit wm8995_spi_probe(struct spi_device *spi) ret = snd_soc_register_codec(&spi->dev, &soc_codec_dev_wm8995, wm8995_dai, ARRAY_SIZE(wm8995_dai)); - if (ret < 0) - goto err_regmap; - - return ret; - -err_regmap: - regmap_exit(wm8995->regmap); - return ret; } static int __devexit wm8995_spi_remove(struct spi_device *spi) { - struct wm8995_priv *wm8995 = spi_get_drvdata(spi); snd_soc_unregister_codec(&spi->dev); - regmap_exit(wm8995->regmap); return 0; } @@ -2319,7 +2309,7 @@ static __devinit int wm8995_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, wm8995); - wm8995->regmap = regmap_init_i2c(i2c, &wm8995_regmap); + wm8995->regmap = devm_regmap_init_i2c(i2c, &wm8995_regmap); if (IS_ERR(wm8995->regmap)) { ret = PTR_ERR(wm8995->regmap); dev_err(&i2c->dev, "Failed to register regmap: %d\n", ret); @@ -2329,25 +2319,15 @@ static __devinit int wm8995_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8995, wm8995_dai, ARRAY_SIZE(wm8995_dai)); - if (ret < 0) { + if (ret < 0) dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); - goto err_regmap; - } - - return ret; - -err_regmap: - regmap_exit(wm8995->regmap); return ret; } static __devexit int wm8995_i2c_remove(struct i2c_client *client) { - struct wm8995_priv *wm8995 = i2c_get_clientdata(client); - snd_soc_unregister_codec(&client->dev); - regmap_exit(wm8995->regmap); return 0; }