From patchwork Mon Aug 26 13:18:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 11114571 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 467D91399 for ; Mon, 26 Aug 2019 13:20:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B043206E0 for ; Mon, 26 Aug 2019 13:20:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="nNkNf2SN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="qoQJQ44/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B043206E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 24308167D; Mon, 26 Aug 2019 15:19:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 24308167D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566825609; bh=Lk8v+58Hli14nqVoT0SQrmWn0e04tfChezN/WWtkdYI=; h=Date:From:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=nNkNf2SNL5HFzzKSNJk0s0ZX8fit9fEK16IEgpMsB5hgkqYSDsXeYm3GS4P5XT9ET qv+EHLJ4QL0/qDrrULESqTnuPbg8bHCN1tF4Q1CmUbLAuRK1ahPV27An6x2rJgbp98 2StjGBO7rf5X+nVu1WB7incS2Q8rkLqQ9fsT+BgU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 56C5EF802BC; Mon, 26 Aug 2019 15:19:18 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D5431F80362; Mon, 26 Aug 2019 15:19:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,SPF_NONE,UNPARSEABLE_RELAY autolearn=disabled version=3.4.0 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BCAB0F8014A for ; Mon, 26 Aug 2019 15:19:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BCAB0F8014A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="qoQJQ44/" Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7QDIl2W124471; Mon, 26 Aug 2019 13:19:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2019-08-05; bh=OMG1pynpH7rciPTOlL0JDJpvKLWRWct9M4/NZ4bPBt8=; b=qoQJQ44/xJcI1wJ5JHQT/pwJbYZi9JDc2jXPH1pE5svd67DplDeZa02y/TWB30m0YC4L FCOSOdcR+JtQuRWfQ7tirn4Yys/2XF7VKhcGkaP74jSSb/GnDGwlv5s3cqDujhJ5BCo/ e4xAxulq6gbgxzgzk2u+tO//IrtvLAXewrTEPUJaPXdMtNnOldjzijzeTkAcwhvBRLaq E5JIg3iApDs2825nJDTbtGM6ImBDraoyxMcDwQkgWsyE+BulHmHej7HtsmQTzkipT8a3 bxcyrE4Vco4/dQ9uqnmGCLopDM22DkXFEQum9wPdx7Yf+bUky8ieCZQ7l0X+Dhj1JDWz rg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2ujwvq8xbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Aug 2019 13:19:08 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7QDIpJm142663; Mon, 26 Aug 2019 13:19:08 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2ujw6hub8a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Aug 2019 13:19:08 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x7QDJ4dt012127; Mon, 26 Aug 2019 13:19:04 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Aug 2019 06:19:04 -0700 Date: Mon, 26 Aug 2019 16:18:55 +0300 From: Dan Carpenter To: Liam Girdwood , Daniel Baluta Message-ID: <20190826131855.GA6840@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9360 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908260145 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9360 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908260145 Cc: Pierre-Louis Bossart , alsa-devel@alsa-project.org, Fabio Estevam , Sascha Hauer , kernel-janitors@vger.kernel.org, Takashi Iwai , Mark Brown , NXP Linux Team , Pengutronix Kernel Team , Shawn Guo Subject: [alsa-devel] [PATCH] ASoC: SOF: imx8: Fix an is IS_ERR() vs NULL check X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" The device_link_add() function only returns NULL on error, it doesn't return error pointers. Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support") Signed-off-by: Dan Carpenter Reviewed-by: Daniel Baluta --- sound/soc/sof/imx/imx8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index e502f584207f..41ad3a310808 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -227,8 +227,8 @@ static int imx8_probe(struct snd_sof_dev *sdev) DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE); - if (IS_ERR(priv->link[i])) { - ret = PTR_ERR(priv->link[i]); + if (!priv->link[i]) { + ret = -ENOMEM; dev_pm_domain_detach(priv->pd_dev[i], false); goto exit_unroll_pm; }