From patchwork Thu Feb 9 00:16:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9563825 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 55AF060216 for ; Thu, 9 Feb 2017 00:17:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8EE228538 for ; Thu, 9 Feb 2017 00:17:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC9F42853D; Thu, 9 Feb 2017 00:17:52 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CAEC428538 for ; Thu, 9 Feb 2017 00:17:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cbcQl-00089x-Ik; Thu, 09 Feb 2017 00:17:47 +0000 Received: from mail-pg0-f67.google.com ([74.125.83.67]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cbcQi-000894-Eb for linux-arm-kernel@lists.infradead.org; Thu, 09 Feb 2017 00:17:45 +0000 Received: by mail-pg0-f67.google.com with SMTP id v184so16160271pgv.1 for ; Wed, 08 Feb 2017 16:17:23 -0800 (PST) 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=YAtED+0dPxRwAJn0U2ht1huG/IzmGcX43a2BSjSNKPM=; b=XH3jkjcUG8gOc0Ygk6NJAjhxB1h84u3UBBimUqIHJFNOajYIoPhZb/FjLrcGdAolpn 8yzsheW54DUQtgQ1+i2rYxq8O+cP6aNnBywGNrafGOltvbvXLXx5I060H9UiO3lWtIxo YhYUWJ7ecvqb8aU15pl+JG1QKnHgGGrPMzIHfojpFIAqHT6iyFxGPtB4wJI0LbPjK03v XkDmL4GxOHVQq1arboyIWzxxHT220a+idCV1A4Kl6I52KmVm1aRyNLsMPgT3+g1szKM+ /5KYT9y1+7FGZlihPdIWs061vW4spFG4MFbSuf0O/pywtCzkOq8eUQF2tWSanZaq5HD0 J8uQ== 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=YAtED+0dPxRwAJn0U2ht1huG/IzmGcX43a2BSjSNKPM=; b=iwl6/XwzQ4ZSpFO/Mle65ittyV3sRAN0OnMoT3DU9Cm1DfgBfyk0bekd5b/Mhn2fKw OdCwB5kk1ZBJ95ZoE8jMjJfFsyo7zFXsO79S6ss0F79zPwNOOH1kDd1hsXwlo93Puxwp gv2RKaxf1dzSAGdiNV7Ko2Yp2iKqKk5j6Kico/IdsdhO55K5IEctwqRJfYYm4tB6xPai DVRgoCLIIjutdfkNiHByXDATuP5vJAOqi682ZXDsqqgTJHADsR9aIAcMFMWhXiOCWMYH j5hSW/WigOhQPmPKzh11VfBh76cLpOKUoCqaF93l8mbY6TXBb3js+m0SxHHSG9CWWu+7 GViQ== X-Gm-Message-State: AMke39mdbzPxIA9C0/hYDyDXPdE25pWxRohRmHmbPcKCkobJ5Lqdic1n2sWx4lvZE0fk+Q== X-Received: by 10.99.121.77 with SMTP id u74mr344180pgc.200.1486599382748; Wed, 08 Feb 2017 16:16:22 -0800 (PST) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id k76sm23145406pfg.42.2017.02.08.16.16.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Feb 2017 16:16:22 -0800 (PST) From: Wei Yongjun To: Alessandro Zummo , Alexandre Belloni , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init() Date: Thu, 9 Feb 2017 00:16:13 +0000 Message-Id: <20170209001613.21665-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170208_161744_526124_D37F116E X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yongjun , linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function of_io_request_and_map() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 847b8bf62eb4 ("rtc: sun6i: Expose the 32kHz oscillator") Signed-off-by: Wei Yongjun Acked-by: Maxime Ripard --- drivers/rtc/rtc-sun6i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 08510ca..39cbc12 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -202,7 +202,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node) spin_lock_init(&rtc->lock); rtc->base = of_io_request_and_map(node, 0, of_node_full_name(node)); - if (!rtc->base) { + if (IS_ERR(rtc->base)) { pr_crit("Can't map RTC registers"); return; }