From patchwork Thu Nov 22 04:08:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13056 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 D89E84C178B for ; Thu, 22 Nov 2012 04:15:30 +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 846FCA1897E for ; Thu, 22 Nov 2012 04:15:30 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so48424ieb.11 for ; Wed, 21 Nov 2012 20:15:30 -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=vjGK+RI2rY6prb6Akfrx+Kw0Rm8Em/aGejNQ732A4A0=; b=kwbYbylU9jWvwDJ8UHT8Mft9uDo0MA9SlCvvhQOhx/8N6VZ2tclB7L7IZoVpWogCF7 wuY+WQonJqzrFOGwbCZur8wnzrKhu0yJKG3cClMt1R4RdYVpZzLr8nZ1p6O8QtQdCaMI PXRLq8DGigAmbcUaSa4pdwKEQzFDvdlX5+2H51z7IXnAzR+vEAk8eh6WWV3Go4mrhd9N yqph6u+i9kyqYCS8wcFaYpxlt1xN4bkTlGoP/OBV3Bx9H+b3zWNoMOtNvdIAikMFffnb Xrxe2BXluF21gaHHc09FVjh07DJrq28CF+16dWF3MN1MGo557Y5amF8txD40Kw70Ef0n xRUw== Received: by 10.50.213.34 with SMTP id np2mr1788415igc.57.1353557730325; Wed, 21 Nov 2012 20:15:30 -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 n20csp147908igt; Wed, 21 Nov 2012 20:15:29 -0800 (PST) Received: by 10.68.248.74 with SMTP id yk10mr752423pbc.86.1353557729759; Wed, 21 Nov 2012 20:15:29 -0800 (PST) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by mx.google.com with ESMTPS id gk10si3325413pbc.356.2012.11.21.20.15.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.49 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.220.49; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.49 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-pa0-f49.google.com with SMTP id bi1so2735780pad.8 for ; Wed, 21 Nov 2012 20:15:29 -0800 (PST) Received: by 10.66.78.6 with SMTP id x6mr23345040paw.45.1353557729519; Wed, 21 Nov 2012 20:15:29 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id s7sm1164602paz.7.2012.11.21.20.15.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:26 -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 07/10] ASoC: wm8804: Convert to use devm_regmap_init_{spi, i2c}() Date: Thu, 22 Nov 2012 09:38:39 +0530 Message-Id: <1353557322-25353-8-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: ALoCoQkz+uMpehFXbUomA4ep7v9D0pPvdks7bVF5NibSMq7aSbdiEPEU4MWslJoCDxk+upoEVfeb Signed-off-by: Tushar Behera --- sound/soc/codecs/wm8804.c | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c index c088020..837bfb5 100644 --- a/sound/soc/codecs/wm8804.c +++ b/sound/soc/codecs/wm8804.c @@ -711,7 +711,7 @@ static int __devinit wm8804_spi_probe(struct spi_device *spi) if (!wm8804) return -ENOMEM; - wm8804->regmap = regmap_init_spi(spi, &wm8804_regmap_config); + wm8804->regmap = devm_regmap_init_spi(spi, &wm8804_regmap_config); if (IS_ERR(wm8804->regmap)) { ret = PTR_ERR(wm8804->regmap); return ret; @@ -727,9 +727,7 @@ static int __devinit wm8804_spi_probe(struct spi_device *spi) static int __devexit wm8804_spi_remove(struct spi_device *spi) { - struct wm8804_priv *wm8804 = spi_get_drvdata(spi); snd_soc_unregister_codec(&spi->dev); - regmap_exit(wm8804->regmap); return 0; } @@ -755,7 +753,7 @@ static __devinit int wm8804_i2c_probe(struct i2c_client *i2c, if (!wm8804) return -ENOMEM; - wm8804->regmap = regmap_init_i2c(i2c, &wm8804_regmap_config); + wm8804->regmap = devm_regmap_init_i2c(i2c, &wm8804_regmap_config); if (IS_ERR(wm8804->regmap)) { ret = PTR_ERR(wm8804->regmap); return ret; @@ -765,23 +763,12 @@ static __devinit int wm8804_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8804, &wm8804_dai, 1); - if (ret != 0) - goto err; - - return 0; - -err: - regmap_exit(wm8804->regmap); return ret; } static __devexit int wm8804_i2c_remove(struct i2c_client *i2c) { - struct wm8804_priv *wm8804 = i2c_get_clientdata(i2c); - snd_soc_unregister_codec(&i2c->dev); - regmap_exit(wm8804->regmap); - return 0; }