From patchwork Mon Jul 13 05:25:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6775961 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 510A19F2F0 for ; Mon, 13 Jul 2015 08:35:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4704920678 for ; Mon, 13 Jul 2015 08:35:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9B23C2065F for ; Mon, 13 Jul 2015 08:35:05 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2935D26153C; Mon, 13 Jul 2015 10:35: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.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8190A261518; Mon, 13 Jul 2015 10:34: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 0B104261519; Mon, 13 Jul 2015 10:34:55 +0200 (CEST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id CFD63261510 for ; Mon, 13 Jul 2015 10:34:47 +0200 (CEST) Received: by pachj5 with SMTP id hj5so28448380pac.3 for ; Mon, 13 Jul 2015 01:34:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=K43f5Iz16Al/s4qxNeunknWXGWwa0bVqGXhRwQghKBk=; b=P+XZUd2uTqE1kPxuk8A65+/5osZc3lT7LMPkgjU6qtLbMpGor56uw67brwRpKcIaZe A8/hrT8j6AmI/MbfUBT/XMjblOua1leRmXWa9mfK9oG2g9w/hkHyj2sg/ctdu8EWxhkE /sZh7ChFGCwtSikS14vDxxlyB4z8xGJf/b/6ZYEkm1pbpT3b9PwScWwTXqhttonPA1Rk dPQ2rWf6t5T/aAwqRLDSJ4I5qN4TY2RP6DtiwxQyPAYxF65ZEXiSfWulJWPmGpP1heMJ 8zAglJ6BHF9HmTtSQY4c/Y/7W9oydgNOseKXNLK7/iNH/mhlmDZr5i0uZjw2kZFmpsfD febQ== X-Gm-Message-State: ALoCoQkzWomB8jWmPUBHlxrDIOQ6GfbCRpTlIWvJEyOwUQZjLEVSgMN2Qp8WG4Hte304lzL2jqD2 X-Received: by 10.66.63.70 with SMTP id e6mr64890055pas.62.1436765138936; Sun, 12 Jul 2015 22:25:38 -0700 (PDT) Received: from phoenix.local (118-171-142-71.dynamic.hinet.net. [118.171.142.71]) by smtp.gmail.com with ESMTPSA id j9sm17278600pdl.65.2015.07.12.22.25.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jul 2015 22:25:37 -0700 (PDT) Message-ID: <1436765134.21490.1.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Mon, 13 Jul 2015 13:25:34 +0800 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: alsa-devel@alsa-project.org, Arnaud Pouliquen , Liam Girdwood Subject: [alsa-devel] [PATCH 1/2] ASoC: sti-sas: Fix checking return value for ERR_PTR 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Both devm_regmap_init and syscon_regmap_lookup_by_phandle return ERR_PTR on failure. Signed-off-by: Axel Lin --- sound/soc/codecs/sti-sas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/sti-sas.c b/sound/soc/codecs/sti-sas.c index 32db2c2..4168b88 100644 --- a/sound/soc/codecs/sti-sas.c +++ b/sound/soc/codecs/sti-sas.c @@ -568,17 +568,17 @@ static int sti_sas_driver_probe(struct platform_device *pdev) /* Request the DAC & SPDIF registers memory region */ drvdata->dac.virt_regmap = devm_regmap_init(&pdev->dev, NULL, drvdata, drvdata->dev_data->regmap); - if (!drvdata->dac.virt_regmap) { + if (IS_ERR(drvdata->dac.virt_regmap)) { dev_err(&pdev->dev, "audio registers not enabled\n"); - return -EFAULT; + return PTR_ERR(drvdata->dac.virt_regmap); } /* Request the syscon region */ drvdata->dac.regmap = syscon_regmap_lookup_by_phandle(pnode, "st,syscfg"); - if (!drvdata->dac.regmap) { + if (IS_ERR(drvdata->dac.regmap)) { dev_err(&pdev->dev, "syscon registers not available\n"); - return -EFAULT; + return PTR_ERR(drvdata->dac.regmap); } drvdata->spdif.regmap = drvdata->dac.regmap;