From patchwork Fri Apr 10 10:12:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 6194291 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C7349BF4A6 for ; Fri, 10 Apr 2015 10:13:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65492203C0 for ; Fri, 10 Apr 2015 10:13:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 237B220357 for ; Fri, 10 Apr 2015 10:13:06 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E58A2265E00; Fri, 10 Apr 2015 12:13:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 41BCB265DC6; Fri, 10 Apr 2015 12:12:56 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4765F265DDC; Fri, 10 Apr 2015 12:12:55 +0200 (CEST) Received: from mail-vn0-f44.google.com (mail-vn0-f44.google.com [209.85.216.44]) by alsa0.perex.cz (Postfix) with ESMTP id CE39E260606 for ; Fri, 10 Apr 2015 12:12:48 +0200 (CEST) Received: by vnbf129 with SMTP id f129so4397334vnb.9 for ; Fri, 10 Apr 2015 03:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=4hzl8VoVX+Zm67wyKvlkTtzZ1ok5t8m4PVUKGMCiNKQ=; b=CB8TEN5uQ4SxZIttmP6MkJa9BJ+MBhlgbGrUYDd7o6tNxz8eWYDqFumAu8GQk+CCBB 9tGGfCnAI7xh8YrDCFPgbKYwHax1UiOi1uQwwl+QKT+amvJyp3Sd+kdHdtsWhiAs9H1/ VRHes7j8rG0sYtmudVkn5hquenWjQU8sSDQNdz3MI+fCB5sBoeUkaQmS2SGEb6UKifrg 1qAp1vMKBzk7DYJwEJ6I3GSve0PG0C8uT/junbPhz3HaEKtIY8sv5CB0u2lvZ9Aak55k SnFXkOvpQvv0xFnFJcJanmqT6ZQWzWKgDv5NPaQx5t5oYdp9CDfQjyStgmzZZBKfLst5 N6kw== X-Received: by 10.170.200.137 with SMTP id r131mr633875yke.21.1428660767663; Fri, 10 Apr 2015 03:12:47 -0700 (PDT) Received: from localhost.localdomain ([177.194.99.89]) by mx.google.com with ESMTPSA id v11sm1283627yhn.49.2015.04.10.03.12.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Apr 2015 03:12:46 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Fri, 10 Apr 2015 07:12:29 -0300 Message-Id: <1428660749-9637-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: nicoleotsuka@gmail.com, Fabio Estevam , alsa-devel@alsa-project.org, timur@tabi.org Subject: [alsa-devel] [PATCH] ASoC: fsl_ssi: Use devm_ioremap_resource() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam Using platform_get_resource() and devm_ioremap_resource() can make the code a bit simpler. Signed-off-by: Fabio Estevam --- sound/soc/fsl/fsl_ssi.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 143cc16..e8bb8ee 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1288,7 +1288,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) const struct of_device_id *of_id; const char *p, *sprop; const uint32_t *iprop; - struct resource res; + struct resource *res; void __iomem *iomem; char name[64]; @@ -1335,19 +1335,11 @@ static int fsl_ssi_probe(struct platform_device *pdev) } ssi_private->cpu_dai_drv.name = dev_name(&pdev->dev); - /* Get the addresses and IRQ */ - ret = of_address_to_resource(np, 0, &res); - if (ret) { - dev_err(&pdev->dev, "could not determine device resources\n"); - return ret; - } - ssi_private->ssi_phys = res.start; - - iomem = devm_ioremap(&pdev->dev, res.start, resource_size(&res)); - if (!iomem) { - dev_err(&pdev->dev, "could not map device resources\n"); - return -ENOMEM; - } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + iomem = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(iomem)) + return PTR_ERR(iomem); + ssi_private->ssi_phys = res->start; ret = of_property_match_string(np, "clock-names", "ipg"); if (ret < 0) {