From patchwork Mon Aug 3 01:13:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 6926481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 745C99F373 for ; Mon, 3 Aug 2015 01:17:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A596620456 for ; Mon, 3 Aug 2015 01:17:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D8AA420452 for ; Mon, 3 Aug 2015 01:17:25 +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 1ZM4Lq-0001Pt-C5; Mon, 03 Aug 2015 01:15:38 +0000 Received: from mail-pa0-f48.google.com ([209.85.220.48]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZM4Lh-0000LI-W6 for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2015 01:15:32 +0000 Received: by pacgq8 with SMTP id gq8so11366664pac.3 for ; Sun, 02 Aug 2015 18:15:09 -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=7AOt/k+92PUbBddGnfMA3/22WkfZZUJkdTaTWxX4jTI=; b=VFc4ehEkWknXLZ6J9DaAbiELi0VgxnRTIwDby/S5qcEJNwywrpgd4F4NmRSV7vBX70 AKCujOovo8eUyO6LOdcXKFUcqOW3wrSiVtic1HLQSXlHVPnV8etZ7lpb8D/jkWGymeEI qJujOItxwYFaSIfcGEnUhDtkkVEBOPsGvKhaW4/Ul7yKDVwz/7oZN+dvzDcNjuBSHAS/ cP6FbhEG6huVYUqanX3IY1rz4Mu8LDPeHxEYT6vKlEREUBs+rOxyyGnJoqhT5+Uok58W /uEv7XQCNmctKh77A2kbdvRthWvJCAMWFAc96y8YZnIh8/SUrP+4JifggQz/E7QsDJ8A 1PSQ== X-Gm-Message-State: ALoCoQl1cHeJV5i2exIg9GFGZ3gfl8TfTJstlZ6b4XDfjVGvQmofpbAQXiB3h0GZkQeWpOhKNlOZ X-Received: by 10.66.183.10 with SMTP id ei10mr14888413pac.10.1438564507035; Sun, 02 Aug 2015 18:15:07 -0700 (PDT) Received: from localhost.localdomain ([180.150.157.4]) by smtp.gmail.com with ESMTPSA id pd10sm15416289pdb.66.2015.08.02.18.14.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Aug 2015 18:15:05 -0700 (PDT) From: Leo Yan To: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Catalin Marinas , Will Deacon , Michael Turquette , Stephen Boyd , Wei Xu , Haojian Zhuang , Bintian Wang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Guodong Xu , Jian Zhang , Zhenwei Wang , Haoju Mo , Dan Zhao , sunzhaosheng@hisilicon.com, victor.lixin@hisilicon.com Subject: [PATCH v3 1/5] clk: hisi: refine parameter checking for init Date: Mon, 3 Aug 2015 09:13:34 +0800 Message-Id: <1438564418-15948-2-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438564418-15948-1-git-send-email-leo.yan@linaro.org> References: <1438564418-15948-1-git-send-email-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150802_181530_479406_A301B319 X-CRM114-Status: GOOD ( 13.09 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan 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.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 c90a897..156435d 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; }