From patchwork Thu Nov 22 04:08:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13053 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 B92304C178B for ; Thu, 22 Nov 2012 04:15:15 +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 68444A1897E for ; Thu, 22 Nov 2012 04:15:15 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so2945499iag.11 for ; Wed, 21 Nov 2012 20:15:14 -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=jZ8WHyte1FVXIiJd04XILqZoUslNnRd9f9swlrYrf0E=; b=TFFzT0GttVRxgIk247gMTqNK62r0E9HT5PMTxbx3xdA/NZmaptFmEPpvG8555wiG0X MCQGK6Mn3N8i/g22CDFJo3ZlxHuc817gnjYR3lFqaJmwbwNGd1V4k2Xw8YBakKLVyNpS hbzMXqhYBUH+rDBgL+HLh8ylg6hamyyFse6D+imyPZmkpWLfugw4lb1j2jOKUIdDRCgQ x0HNOFQBYFlP+KyCRCiJ1MQ8JfaS83ssHBi3ruZFc84hxl+iThT/Y1Vr6UdHBXFZgiJJ 4FBaaqJ/7c4AlI8XDZj1BzZ+m2MUmZCxxS5HQz/ENICE+vc0RoQpyI0p302jq6e3l3hs kyjw== Received: by 10.50.187.197 with SMTP id fu5mr1739473igc.70.1353557714820; Wed, 21 Nov 2012 20:15:14 -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 n20csp147879igt; Wed, 21 Nov 2012 20:15:14 -0800 (PST) Received: by 10.68.239.9 with SMTP id vo9mr764374pbc.83.1353557714199; Wed, 21 Nov 2012 20:15:14 -0800 (PST) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id ka8si3352468pbc.245.2012.11.21.20.15.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:14 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.41 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-f41.google.com with SMTP id xa7so5977076pbc.14 for ; Wed, 21 Nov 2012 20:15:14 -0800 (PST) Received: by 10.69.0.8 with SMTP id au8mr812547pbd.58.1353557713965; Wed, 21 Nov 2012 20:15:13 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id s7sm1164602paz.7.2012.11.21.20.15.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:15:12 -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 04/10] ASoC: ak4104: Convert to use devm_regmap_init_spi() Date: Thu, 22 Nov 2012 09:38:36 +0530 Message-Id: <1353557322-25353-5-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: ALoCoQnuohd2oDczabgKn6VaNAvMRfj2uFHnl0q2eowH6lUjtBRqE2iNoalDCK39jGeDKaw/cJrG Signed-off-by: Tushar Behera --- sound/soc/codecs/ak4104.c | 19 ++++--------------- 1 files changed, 4 insertions(+), 15 deletions(-) diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c index eec086b..4b11b82 100644 --- a/sound/soc/codecs/ak4104.c +++ b/sound/soc/codecs/ak4104.c @@ -222,7 +222,7 @@ static int ak4104_spi_probe(struct spi_device *spi) if (ak4104 == NULL) return -ENOMEM; - ak4104->regmap = regmap_init_spi(spi, &ak4104_regmap); + ak4104->regmap = devm_regmap_init_spi(spi, &ak4104_regmap); if (IS_ERR(ak4104->regmap)) { ret = PTR_ERR(ak4104->regmap); return ret; @@ -247,30 +247,19 @@ static int ak4104_spi_probe(struct spi_device *spi) * the device, but there is no hardware ID register. */ ret = regmap_read(ak4104->regmap, AK4104_REG_RESERVED, &val); if (ret != 0) - goto err; - if (val != AK4104_RESERVED_VAL) { - ret = -ENODEV; - goto err; - } + return ret; + if (val != AK4104_RESERVED_VAL) + return -ENODEV; spi_set_drvdata(spi, ak4104); ret = snd_soc_register_codec(&spi->dev, &soc_codec_device_ak4104, &ak4104_dai, 1); - if (ret != 0) - goto err; - - return 0; - -err: - regmap_exit(ak4104->regmap); return ret; } static int __devexit ak4104_spi_remove(struct spi_device *spi) { - struct ak4104_private *ak4101 = spi_get_drvdata(spi); - regmap_exit(ak4101->regmap); snd_soc_unregister_codec(&spi->dev); return 0; }