From patchwork Mon Nov 26 11:49:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13207 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 E5A6323FC6 for ; Mon, 26 Nov 2012 11:56: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 94EF1A19675 for ; Mon, 26 Nov 2012 11:56:44 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so4419020ieb.11 for ; Mon, 26 Nov 2012 03:56: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=GdlJZsYqOqiCdM1RV5+MdoAPtJE9eg1YDCeJgDMWNmg=; b=h/4iMZFaxFYRgCaECDct4PfhFvgbq/aulWba4JZIfAF8yhUu2aIdp2iBcokX2Y0WKo yt9SYS17VQAExEwc1XFJ11VnRFD7Zb5LW2IE/Bid4yy8jDHqRKMXJVgZ49ijvm1xDmID hblHm9SWDVHv98/Z/gFcLhYwPtiLucEugsumPJdipb+cK06f91Axzv1trM90hVrI3heK ywR31nIzxc1CGDzbnL4b5MVvaYEeXnNpdB+Kj86LhOdXndsdBUrfHqcjU9dQeskt5+In VBLxoo9ajSCAqqBRfRAyyhDDz+SNQaxsWbli3nA2ZGdu4hcpyjpYc9wB9l5jCk4uaxJw sLkA== Received: by 10.50.91.195 with SMTP id cg3mr13361507igb.57.1353931004395; Mon, 26 Nov 2012 03:56: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 n20csp245110igt; Mon, 26 Nov 2012 03:56:44 -0800 (PST) Received: by 10.68.197.9 with SMTP id iq9mr36366880pbc.130.1353931003921; Mon, 26 Nov 2012 03:56:43 -0800 (PST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx.google.com with ESMTPS id uq10si19290695pbc.227.2012.11.26.03.56.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 03:56:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.54 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-pa0-f54.google.com with SMTP id bi5so2298581pad.13 for ; Mon, 26 Nov 2012 03:56:43 -0800 (PST) Received: by 10.66.79.133 with SMTP id j5mr32029173pax.51.1353931003696; Mon, 26 Nov 2012 03:56:43 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id kb3sm8677482pbc.27.2012.11.26.03.56.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 03:56:43 -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 09/14] ASoC: wm8955: Use devm_regmap_init_i2c() Date: Mon, 26 Nov 2012 17:19:42 +0530 Message-Id: <1353930587-12907-10-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: ALoCoQkW+jeST979yXPEyH+B/QgDS15APbUZoHpd682odMtbre6yuNzaviUof1CpeBqoCf1poaXC devm_regmap_init_i2c() is device managed and makes error handling and code cleanup simpler. Signed-off-by: Sachin Kamat --- sound/soc/codecs/wm8955.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index 2f1c075..7a82b7d 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c @@ -1023,7 +1023,7 @@ static __devinit int wm8955_i2c_probe(struct i2c_client *i2c, if (wm8955 == NULL) return -ENOMEM; - wm8955->regmap = regmap_init_i2c(i2c, &wm8955_regmap); + wm8955->regmap = devm_regmap_init_i2c(i2c, &wm8955_regmap); if (IS_ERR(wm8955->regmap)) { ret = PTR_ERR(wm8955->regmap); dev_err(&i2c->dev, "Failed to allocate register map: %d\n", @@ -1035,22 +1035,13 @@ static __devinit int wm8955_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm8955, &wm8955_dai, 1); - if (ret != 0) - goto err; return ret; - -err: - regmap_exit(wm8955->regmap); - return ret; } static __devexit int wm8955_i2c_remove(struct i2c_client *client) { - struct wm8955_priv *wm8955 = i2c_get_clientdata(client); - snd_soc_unregister_codec(&client->dev); - regmap_exit(wm8955->regmap); return 0; }