From patchwork Mon Jul 25 07:08:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9245369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 15ABC607FD for ; Mon, 25 Jul 2016 07:55:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0604E22380 for ; Mon, 25 Jul 2016 07:55:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9463262FF; Mon, 25 Jul 2016 07:55:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E1DD22380 for ; Mon, 25 Jul 2016 07:55:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C245B6E321; Mon, 25 Jul 2016 07:55:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x243.google.com (mail-pa0-x243.google.com [IPv6:2607:f8b0:400e:c03::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id D2E016E2EE for ; Mon, 25 Jul 2016 07:08:14 +0000 (UTC) Received: by mail-pa0-x243.google.com with SMTP id q2so10945498pap.0 for ; Mon, 25 Jul 2016 00:08:14 -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:mime-version :content-transfer-encoding; bh=yrEyc24GEXinEOckheNdZRnwk1EBWKfeJiziUX5WyEQ=; b=Mb/vbE1sTJSomsf4CgLEP7srGo54eRYpwMHmzDtEgbFpnBtaB544hmhv6rj0Na+vau qnDK8VM4982qyUHBt2YLPSK//ZeAJRA1s6fAMpyNzcVpw+3W+zcGU15zZ4Uyq93L6IJh 9812UwZyLox26S2y0zAkq87m7es4c9eLtnMpAbOUB3L9kHYxkkcfk9wnpZYEnXnOBy4L zUAyfhpiZWfTPEtCFpLxVetwebSlIFwkZU0+C53hgr8CqO3VdD2MIdsvBxKpWEyHoyKO z/4EGuTh7YAkyKqcqWQ9udfqKN4mQbMEdycJ9I/ULGs88dGkaX07rM2I0S4Ga+ZCbENd OXyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yrEyc24GEXinEOckheNdZRnwk1EBWKfeJiziUX5WyEQ=; b=EgF+g2zTxwi09DsQrSApGu4Zz7B42J0YWA/yaYa7ewGysa4Ub1BGDMWLJ9zHpqH+Rb Mhp/Hzxk37iGwFFcTAaZObTEMaAyt3bY7k96xkBzx1i/UqaKVjunNknPJAi7gFuYJkQg 1YG8Ma++9AJQivIaNY7AMvk4PB6Mf2MfPZqf10I5BT1pB2f5Ua83Sy8SjZxu4M29IwAM CKhL0utAEa0DgMT2z+5UNhfdZCcczIsER3NjS8mVICHzpEnJZmDvU9yGQ4mTvaQEAT6t 07bw4xD2cmY9wO2ddZkudDNuaLjUB6v1qRfEgovPw21XIB68VnzWcDpXEznDyrC4gZx8 CUkw== X-Gm-Message-State: AEkoouuk+3sk0gNTKbbKvvM8qKCfAYSmlr+NwfTOM/2nDyBtJ+sgdq0tCupKHZcp22jF+A== X-Received: by 10.66.217.132 with SMTP id oy4mr27091479pac.46.1469430493186; Mon, 25 Jul 2016 00:08:13 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id f10sm37152400pfc.79.2016.07.25.00.08.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jul 2016 00:08:12 -0700 (PDT) From: Wei Yongjun To: Stefan Agner , Alison Wang , David Airlie Subject: [PATCH -next] drm/fsl-dcu: use PTR_ERR_OR_ZERO() to simplify the code Date: Mon, 25 Jul 2016 07:08:07 +0000 Message-Id: <1469430487-8897-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 25 Jul 2016 07:55:09 +0000 Cc: Wei Yongjun , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Wei Yongjun --- drivers/gpu/drm/fsl-dcu/fsl_tcon.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_tcon.c b/drivers/gpu/drm/fsl-dcu/fsl_tcon.c index bca09ea..3194e54 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_tcon.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_tcon.c @@ -57,10 +57,7 @@ static int fsl_tcon_init_regmap(struct device *dev, tcon->regs = devm_regmap_init_mmio(dev, regs, &fsl_tcon_regmap_config); - if (IS_ERR(tcon->regs)) - return PTR_ERR(tcon->regs); - - return 0; + return PTR_ERR_OR_ZERO(tcon->regs); } struct fsl_tcon *fsl_tcon_init(struct device *dev)