From patchwork Thu Nov 22 04:08:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13058 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 DF86A4C178B for ; Thu, 22 Nov 2012 04:15:39 +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 9085FA18FDE for ; Thu, 22 Nov 2012 04:15:39 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so48424ieb.11 for ; Wed, 21 Nov 2012 20:15:39 -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=VyVvqxgpIpDzlRzfQEnEOXuCGsAhD3VvtJQLw/PSD7Q=; b=btutPgxJH1HZQhVLP62xaIy+WotK8jsbcs1GOLAhRV9NdYsIDdTUPc5LWLYH3DGe+G 8I7+/7k6FodGheWbqpen7/K8OvaUzRfkk73WCIMmcGiNaxdamAHrYOwyV484N1SoU2wh 9IBweZZhP8Eve4UkjsMC8yIvRVsQQanTxkBXpkzPfnk0B76/gn6qxF9+zz960lk8sCjK eIRMr08ERljrIrosTcvQypdJrvKPrKxeze72pvBxo5QBEZzSTDjNqM74D7cjBGcTxQtj FB0NC0CsxZhlSsjy26siX1GYHPwfZsKRImdHr0HYDuI/yqKGDGPzR5KAYz7ps/x3YRYj 3t7w== Received: by 10.50.152.137 with SMTP id uy9mr1751549igb.62.1353557739380; Wed, 21 Nov 2012 20:15:39 -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 n20csp147921igt; Wed, 21 Nov 2012 20:15:39 -0800 (PST) Received: by 10.68.189.233 with SMTP id gl9mr547986pbc.166.1353557738837; Wed, 21 Nov 2012 20:15:38 -0800 (PST) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx.google.com with ESMTPS id w3si3350800pbz.258.2012.11.21.20.15.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.54 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.54 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-f54.google.com with SMTP id wz12so6956052pbc.27 for ; Wed, 21 Nov 2012 20:15:38 -0800 (PST) Received: by 10.69.16.100 with SMTP id fv4mr630962pbd.135.1353557738623; Wed, 21 Nov 2012 20:15:38 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id s7sm1164602paz.7.2012.11.21.20.15.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:37 -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 09/10] ASoC: wm8988: Convert to use devm_regmap_init_{spi, i2c}() Date: Thu, 22 Nov 2012 09:38:41 +0530 Message-Id: <1353557322-25353-10-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: ALoCoQmS2QQ3aPB9tWBSJrZ301sUdvPQigO2FzRGU7E8Ymal/D/7b07Cxs3hCkmjPl5KW9b7gq9r Signed-off-by: Tushar Behera --- sound/soc/codecs/wm8988.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c index 1d4c5cf..715788d 100644 --- a/sound/soc/codecs/wm8988.c +++ b/sound/soc/codecs/wm8988.c @@ -882,7 +882,7 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi) if (wm8988 == NULL) return -ENOMEM; - wm8988->regmap = regmap_init_spi(spi, &wm8988_regmap); + wm8988->regmap = devm_regmap_init_spi(spi, &wm8988_regmap); if (IS_ERR(wm8988->regmap)) { ret = PTR_ERR(wm8988->regmap); dev_err(&spi->dev, "Failed to init regmap: %d\n", ret); @@ -893,17 +893,12 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi) ret = snd_soc_register_codec(&spi->dev, &soc_codec_dev_wm8988, &wm8988_dai, 1); - if (ret != 0) - regmap_exit(wm8988->regmap); - return ret; } static int __devexit wm8988_spi_remove(struct spi_device *spi) { - struct wm8988_priv *wm8988 = spi_get_drvdata(spi); snd_soc_unregister_codec(&spi->dev); - regmap_exit(wm8988->regmap); return 0; } @@ -931,7 +926,7 @@ static __devinit int wm8988_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, wm8988); - wm8988->regmap = regmap_init_i2c(i2c, &wm8988_regmap); + wm8988->regmap = devm_regmap_init_i2c(i2c, &wm8988_regmap); if (IS_ERR(wm8988->regmap)) { ret = PTR_ERR(wm8988->regmap); dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret); @@ -940,17 +935,12 @@ static __devinit int wm8988_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8988, &wm8988_dai, 1); - if (ret != 0) - regmap_exit(wm8988->regmap); - return ret; } static __devexit int wm8988_i2c_remove(struct i2c_client *client) { - struct wm8988_priv *wm8988 = i2c_get_clientdata(client); snd_soc_unregister_codec(&client->dev); - regmap_exit(wm8988->regmap); return 0; }