From patchwork Thu Nov 22 04:08:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13057 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 A05C24C178B for ; Thu, 22 Nov 2012 04:15:35 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4ABEBA189FC for ; Thu, 22 Nov 2012 04:15:35 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so2945499iag.11 for ; Wed, 21 Nov 2012 20:15:35 -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=RyUzmEL1uusfFVUXg5NjLPCDit6+IA9eoSCi3G6rRf0=; b=gBJTDui2uwYPABHPJa5iqM26dN8/8BKQL6WLDL/xmIkVIcpfPvouiRMeJ17V+yr4J4 WCrHw5tiAnKm1/R66vzlNPIqJbDXeL+k3RBq4yzht/5KRt757ctJ6KAegc/jGxxoWVqT /IE18MRALvfT7aAVh1iJZmc+EY92torZzYbfeLgZHTnaT0TDgmdT84h8Q50kUPjvO+bZ KkLhCo1pwADOc6wuv7V0VGaoOr65hKrpr6pZYZiW1ojl3amkTWph5hpiTW60BgJL/R/j ixj28ub7BAbUtPyfQQWF8aFTXagAkEu7R5yZidjAzuxOFvEVexbpKKJPXfhwtEaj7/3e Xm7Q== Received: by 10.50.161.169 with SMTP id xt9mr1749390igb.62.1353557735076; Wed, 21 Nov 2012 20:15:35 -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 n20csp147915igt; Wed, 21 Nov 2012 20:15:34 -0800 (PST) Received: by 10.69.16.100 with SMTP id fv4mr630395pbd.135.1353557734618; Wed, 21 Nov 2012 20:15:34 -0800 (PST) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id e3si2852862pax.225.2012.11.21.20.15.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.46; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.46 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-f46.google.com with SMTP id wy7so5576748pbc.19 for ; Wed, 21 Nov 2012 20:15:34 -0800 (PST) Received: by 10.66.88.102 with SMTP id bf6mr23550616pab.10.1353557734388; Wed, 21 Nov 2012 20:15:34 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id s7sm1164602paz.7.2012.11.21.20.15.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:32 -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 08/10] ASoC: wm8985: Convert to use devm_regmap_init_{spi, i2c}() Date: Thu, 22 Nov 2012 09:38:40 +0530 Message-Id: <1353557322-25353-9-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: ALoCoQnswjgTH5p4p2EYfsI6inx4vIQGRiLGunpkVBLQ1/VhKp4mORiAPosooziflppk4Mdb8Ddf Signed-off-by: Tushar Behera --- sound/soc/codecs/wm8985.c | 30 ++++-------------------------- 1 files changed, 4 insertions(+), 26 deletions(-) diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c index 14f6663..7b3f409 100644 --- a/sound/soc/codecs/wm8985.c +++ b/sound/soc/codecs/wm8985.c @@ -1122,33 +1122,22 @@ static int __devinit wm8985_spi_probe(struct spi_device *spi) spi_set_drvdata(spi, wm8985); - wm8985->regmap = regmap_init_spi(spi, &wm8985_regmap); + wm8985->regmap = devm_regmap_init_spi(spi, &wm8985_regmap); if (IS_ERR(wm8985->regmap)) { ret = PTR_ERR(wm8985->regmap); dev_err(&spi->dev, "Failed to allocate register map: %d\n", ret); - goto err; + return ret; } ret = snd_soc_register_codec(&spi->dev, &soc_codec_dev_wm8985, &wm8985_dai, 1); - if (ret != 0) - goto err; - - return 0; - -err: - regmap_exit(wm8985->regmap); return ret; } static int __devexit wm8985_spi_remove(struct spi_device *spi) { - struct wm8985_priv *wm8985 = spi_get_drvdata(spi); - snd_soc_unregister_codec(&spi->dev); - regmap_exit(wm8985->regmap); - return 0; } @@ -1175,33 +1164,22 @@ static __devinit int wm8985_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, wm8985); - wm8985->regmap = regmap_init_i2c(i2c, &wm8985_regmap); + wm8985->regmap = devm_regmap_init_i2c(i2c, &wm8985_regmap); if (IS_ERR(wm8985->regmap)) { ret = PTR_ERR(wm8985->regmap); dev_err(&i2c->dev, "Failed to allocate register map: %d\n", ret); - goto err; + return ret; } ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8985, &wm8985_dai, 1); - if (ret != 0) - goto err; - - return 0; - -err: - regmap_exit(wm8985->regmap); return ret; } static __devexit int wm8985_i2c_remove(struct i2c_client *i2c) { - struct wm8985_priv *wm8985 = i2c_get_clientdata(i2c); - snd_soc_unregister_codec(&i2c->dev); - regmap_exit(wm8985->regmap); - return 0; }