From patchwork Mon Nov 26 11:49:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13203 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 BFF1323FC6 for ; Mon, 26 Nov 2012 11:56:31 +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 71BBEA19675 for ; Mon, 26 Nov 2012 11:56:31 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so5135959iag.11 for ; Mon, 26 Nov 2012 03:56:31 -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=d0DODes3fw8Ljag+RTG42RvyBu+mjtjCEXVR0OjwWts=; b=KqKvEYD2tTicJdNlI0XE6C5trUX42iyEZjSXd7gIL/eLTtLBLgfBciAZjifNq2eGCH odMtxriiZY1OP9JLUS0LwMGHfMl7n1qnnhNHrMdym5MQLJLEfJ7z9ynmnWWlNG6DmHAD vgpt3O89Ta43dKABBU5gocESulbWraMYlQtPUZFvr+BCQjfhx2zLrW9FA3LUHuIADsXA IxMUCjAY/1QqsTH2OXogV3f9SIO0f7gVKo0Chr8xP4ufVSFLdzCMi+/W7ULMCrfxUcCG 5wPmWFcFcm+XwBK7BgGX5H1s8aX00Mmx4TdatgGLtmEkoRV72Q6zA2ElFu3quF4/gAer AxCw== Received: by 10.43.125.133 with SMTP id gs5mr9565009icc.54.1353930991237; Mon, 26 Nov 2012 03:56:31 -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 n20csp245080igt; Mon, 26 Nov 2012 03:56:30 -0800 (PST) Received: by 10.68.239.232 with SMTP id vv8mr36810387pbc.53.1353930990685; Mon, 26 Nov 2012 03:56:30 -0800 (PST) Received: from mail-da0-f43.google.com (mail-da0-f43.google.com [209.85.210.43]) by mx.google.com with ESMTPS id bd1si15120921pab.131.2012.11.26.03.56.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 03:56:30 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.43 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.43; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.43 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-da0-f43.google.com with SMTP id u36so6293562dak.16 for ; Mon, 26 Nov 2012 03:56:30 -0800 (PST) Received: by 10.68.143.201 with SMTP id sg9mr37636646pbb.32.1353930990444; Mon, 26 Nov 2012 03:56:30 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id kb3sm8677482pbc.27.2012.11.26.03.56.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 03:56:29 -0800 (PST) From: Sachin Kamat To: alsa-devel@alsa-project.org Cc: broonie@opensource.wolfsonmicro.com, lrg@ti.com, tiwai@suse.de, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 05/14] ASoC: ak4535: Use devm_regmap_init_i2c() Date: Mon, 26 Nov 2012 17:19:38 +0530 Message-Id: <1353930587-12907-6-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353930587-12907-1-git-send-email-sachin.kamat@linaro.org> References: <1353930587-12907-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmL3ckeOsBvb2tRb7H5mPHcJ9F77CcefD6LUg/fiDQQIlMMhVBCEv0o0hyWPOEnCU0Ab7Gb devm_regmap_init_i2c() is device managed and makes error handling and code cleanup simpler. Signed-off-by: Sachin Kamat --- sound/soc/codecs/ak4535.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index 618fdc3..fc55810 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c @@ -447,7 +447,7 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c, if (ak4535 == NULL) return -ENOMEM; - ak4535->regmap = regmap_init_i2c(i2c, &ak4535_regmap); + ak4535->regmap = devm_regmap_init_i2c(i2c, &ak4535_regmap); if (IS_ERR(ak4535->regmap)) { ret = PTR_ERR(ak4535->regmap); dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret); @@ -458,18 +458,13 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_ak4535, &ak4535_dai, 1); - if (ret != 0) - regmap_exit(ak4535->regmap); return ret; } static __devexit int ak4535_i2c_remove(struct i2c_client *client) { - struct ak4535_priv *ak4535 = i2c_get_clientdata(client); - snd_soc_unregister_codec(&client->dev); - regmap_exit(ak4535->regmap); return 0; }