From patchwork Mon Mar 30 05:24:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 6118511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 58642BF4A6 for ; Mon, 30 Mar 2015 05:28:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 493B6203AD for ; Mon, 30 Mar 2015 05:28:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5BBCC20374 for ; Mon, 30 Mar 2015 05:28:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YcSCX-0008Tg-LK; Mon, 30 Mar 2015 05:25:29 +0000 Received: from mail-yk0-f170.google.com ([209.85.160.170]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YcSCI-0007Hh-NZ for linux-arm-kernel@lists.infradead.org; Mon, 30 Mar 2015 05:25:15 +0000 Received: by ykef74 with SMTP id f74so33666117yke.1 for ; Sun, 29 Mar 2015 22:24:53 -0700 (PDT) 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:in-reply-to :references; bh=dM511zCAtuib9YvV63hKWLogXITWYMV+MJ30DdBfmeQ=; b=e9XSp6A6rK2RbUkVGYDsf4bfI4befV7vIf+OndAlkjl1OXFlbMzGFgjjoldRpBmAnX 82u6wjHg7zwGFGv2Wyg9bBbTbvbYO8KvR9XUckD6vZ1c3D42j6vxlh2dMTUfh6FOscIq lKdHQrOQt9Cwa5mJpZINtSVgFRm1uiKuJ/XjHAv7xa1oiEKaLtUc6MfNQZKfXvesJ2qD tb5Hg3hXxbBvtKl3Fwl9J4svX86aN3oCuwGjSj4zN8pwy3JgjJ0L8dFqFi+MjeuNT4T+ Z1hICb/WSdiOzJ8wjjiZoOKCvXxCcj2q/6sdtQsktt2s6myVhLlBVVRajrUMnEtmci5a lvrA== X-Gm-Message-State: ALoCoQmsIlDQtOW/lPDu3/2uYzGNo3EwmVCmQDXmbxCjufhy//9XZ2OANCdv2y+XEh/4l94m6ZVm X-Received: by 10.236.110.10 with SMTP id t10mr31447865yhg.35.1427693093122; Sun, 29 Mar 2015 22:24:53 -0700 (PDT) Received: from localhost.localdomain ([104.207.83.1]) by mx.google.com with ESMTPSA id g46sm9852584yhd.42.2015.03.29.22.24.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Mar 2015 22:24:52 -0700 (PDT) From: Leo Yan To: Wei Xu , Dan Zhao , zhenwei.wang@hisilicon.com, Haojian Zhuang , Bintian Wang , mturquette@linaro.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/5] clk: hisi: refine parameter checking for init Date: Mon, 30 Mar 2015 13:24:20 +0800 Message-Id: <1427693064-11062-2-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427693064-11062-1-git-send-email-leo.yan@linaro.org> References: <1427693064-11062-1-git-send-email-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150329_222514_907561_75AC6C71 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Leo Yan X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP *of_iomap()* will check the device node pointer, and if the pointer is NULL it will return error code. So refine clock's init flow by checking the device node with this simple way; and polish a little for the print out message. Signed-off-by: Leo Yan --- drivers/clk/hisilicon/clk.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c index a078e84..1951b37 100644 --- a/drivers/clk/hisilicon/clk.c +++ b/drivers/clk/hisilicon/clk.c @@ -45,14 +45,9 @@ struct hisi_clock_data __init *hisi_clk_init(struct device_node *np, struct clk **clk_table; void __iomem *base; - if (np) { - base = of_iomap(np, 0); - if (!base) { - pr_err("failed to map Hisilicon clock registers\n"); - goto err; - } - } else { - pr_err("failed to find Hisilicon clock node in DTS\n"); + base = of_iomap(np, 0); + if (!base) { + pr_err("%s: failed to map clock registers\n", __func__); goto err; }