From patchwork Tue Apr 25 06:26:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9697559 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 7ABC3601D3 for ; Tue, 25 Apr 2017 06:26:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61FB326419 for ; Tue, 25 Apr 2017 06:26:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53AEB2844E; Tue, 25 Apr 2017 06:26:55 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 D1F4726419 for ; Tue, 25 Apr 2017 06:26:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S980661AbdDYG0x (ORCPT ); Tue, 25 Apr 2017 02:26:53 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34998 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S980632AbdDYG0x (ORCPT ); Tue, 25 Apr 2017 02:26:53 -0400 Received: by mail-pg0-f65.google.com with SMTP id g2so8800660pge.2 for ; Mon, 24 Apr 2017 23:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UBVfbVISl7xhJ3bSRY2V9r75G3AfdnA6DiDKj23pZCs=; b=gfaKmh9CCEhLoD6HT/E/prFp+rmqVQnvGfRPn82o+pTJTqYqnb6Lzd5EIHAZ7m3RBp HUmobzGotAWm8YmaGLH/ubm6ltq3qu7AXE3n43n7jOkPji3Oc3qtjyVsQGn7EOPI+tZJ KJh7Uo57FxJabdrAZnJK95CTbKR0RPvgZEeBmxBy0apGZtl6E9wwcq6rLJSmN/hm/fwq rEIq4pm8UHdKtecXJWNwcCsGBdUlpbNCFCjSo5zPksBnDGbTIi/TNSZ/d9+fodcsAiJ+ mvFfbyYwyjGJTBWDN++vTw5OWWIs6fPJBewv3CkloW9Ni+F2gJsGIE3q7J+Lc+aEPxRR VNFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UBVfbVISl7xhJ3bSRY2V9r75G3AfdnA6DiDKj23pZCs=; b=oAh0UrgMty/WCjNBeQpdajmqO7HaYWhuJfYFxY1W6tDXrJQGhFX9wsNFbhMt0MCAWl X5LwqdMJZRy/r4Bj8jyfLjvR2ZhR+7cU45nHdkL6dtRO4axgwt4HgiosMTgyu/LqMr36 2R9KhFOFAiXXD8hlRcW+W3VOwkS5mkPMu9oU01lqUcHfom7Kjjtd4i5hMJxSPkvvCV61 O/+VkbnZnb9yBELf3Ofin1c68R80mxIZzHqV0vew+0FPmcLNvJmlXzSIyaORMYcCTiJs pRmNVOLECD6ERlLUggZ22RvyHuttflWMtvtaF+Kge1WVG/In1RtMWRW6cHjlCd43h9Q4 RGkQ== X-Gm-Message-State: AN3rC/7RZ9mU4Lly+6NDD02eCSmqYG2SM8pWvyh+4gzIbnNKPx5E/+2Y fVs3RVRkR88oFg== X-Received: by 10.84.218.142 with SMTP id r14mr36694210pli.54.1493101612624; Mon, 24 Apr 2017 23:26:52 -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 2sm34072870pfs.85.2017.04.24.23.26.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Apr 2017 23:26:52 -0700 (PDT) From: Wei Yongjun To: Dmitry Torokhov , Ksenija Stanojevic , Lee Jones , Marek Vasut Cc: Wei Yongjun , linux-input@vger.kernel.org Subject: [PATCH -next] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe() Date: Tue, 25 Apr 2017 06:26:46 +0000 Message-Id: <20170425062646.26043-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/input/touchscreen/mxs-lradc-ts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" 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/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c index 4b4aebf..ff9cda2 100644 --- a/drivers/input/touchscreen/mxs-lradc-ts.c +++ b/drivers/input/touchscreen/mxs-lradc-ts.c @@ -631,8 +631,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev) iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); ts->base = devm_ioremap(dev, iores->start, resource_size(iores)); - if (IS_ERR(ts->base)) - return PTR_ERR(ts->base); + if (!ts->base) + return -ENOMEM; ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires", &ts_wires);