From patchwork Sat Aug 13 01:26:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9278251 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 9A95960780 for ; Sat, 13 Aug 2016 01:26:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88CF328B3C for ; Sat, 13 Aug 2016 01:26:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C3FE28B3E; Sat, 13 Aug 2016 01:26:37 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 034E128B3C for ; Sat, 13 Aug 2016 01:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752328AbcHMB0g (ORCPT ); Fri, 12 Aug 2016 21:26:36 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33193 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbcHMB0f (ORCPT ); Fri, 12 Aug 2016 21:26:35 -0400 Received: by mail-pa0-f67.google.com with SMTP id vy10so165654pac.0 for ; Fri, 12 Aug 2016 18:26:35 -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=G/yFdPeefI/VkrdBTKFF84wpXtfHn2C7dV8r52klhIM=; b=RIKgs56juuolI5sRKYLb5peSSIuP57gI42+MlA3XKEmDVtZ4UIYquWcJ+8bWw/GmGx 9BtwaF5y4EgxpXwa0Kt9ueFpxgzacHnfs+r5VZ1ntAxmRQG01vMxm2UU60fkgyHK0DHB mV76mnZwZT6DymAWgIr+OJFSAGnPyOTxQ+7Mx5AYHaDQB0KdKUU+jpfu2PslvOVwIa65 dTSNbGzUxHWf/iACrJ0K4nj3HMWYQa7vA72LbsVm7RBm1TzcBbehaxIyWmy8eL35hp8U zzcNq6dKuMg183sTcOAUqY2e2CMXUJEMjZE4B9uNgpuj2iEZJVuJmOUeYyUOHFEZwvPv OcgA== 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=G/yFdPeefI/VkrdBTKFF84wpXtfHn2C7dV8r52klhIM=; b=eo9BAMz7aL1nIEZsidSqV7TlgQEk58MLUjTqfdZ3yB8VZScIPHUhAR9RMa+mqFgLIg wug5mEQ8azJ2objYl/lM4xhZGRFfcZMhaXeSKgjddv0zbZq94mVp+7DQd2tJZ92D/eic 2p62/Upih3J7C/b5VUUFy3d5EodO/J3X7EBm4xwuQOhS3Qjz5/tJsexHwKwyC51bNo7L 2pQ7zK/1VZGHgkH/QQ17jTdkqI1tBLVPzI4KHL7iqUHpc0uE+GAtK9enZVgXWN4R681D 60lek4/J8ssdiXMGW0wQVBAPihx/iDV0k4tEMdRm/af7K+ohHUCUnOBahJ+j9gCgTT90 x9Iw== X-Gm-Message-State: AEkoouve+h7LEMzV4ovTqbJ2MC9FVVEtt6XtC6LmWIbE+pEbJlbaIULN3BL+VbFXC1PJZQ== X-Received: by 10.66.123.105 with SMTP id lz9mr32893712pab.56.1471051594929; Fri, 12 Aug 2016 18:26:34 -0700 (PDT) Received: from bogon.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id c8sm15833406pfe.39.2016.08.12.18.26.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Aug 2016 18:26:34 -0700 (PDT) From: Wei Yongjun To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Linus Walleij , "Luis R. Rodriguez" , Ingo Molnar Cc: Wei Yongjun , linux-fbdev@vger.kernel.org Subject: [PATCH -next] video: ARM CLCD: fix return value check in versatile_clcd_init_panel() Date: Sat, 13 Aug 2016 01:26:26 +0000 Message-Id: <1471051586-26189-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case of error, the function syscon_node_to_regmap() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 25348160e9a4 ("video: ARM CLCD: add special panel hook for Versatiles") Signed-off-by: Wei Yongjun Reviewed-by: Linus Walleij --- drivers/video/fbdev/amba-clcd-versatile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbdev/amba-clcd-versatile.c b/drivers/video/fbdev/amba-clcd-versatile.c index 9a90817..56161f9 100644 --- a/drivers/video/fbdev/amba-clcd-versatile.c +++ b/drivers/video/fbdev/amba-clcd-versatile.c @@ -528,9 +528,9 @@ int versatile_clcd_init_panel(struct clcd_fb *fb, versatile_clcd_type = (enum versatile_clcd)clcd_id->data; map = syscon_node_to_regmap(np); - if (!map) { + if (IS_ERR(map)) { dev_err(dev, "no Versatile syscon regmap\n"); - return -ENODEV; + return PTR_ERR(map); } switch (versatile_clcd_type) {