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: 46466 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2FF16214AF for ; Mon, 30 Mar 2015 05:24:57 +0000 (UTC) Received: by pdnb3 with SMTP id b3sf146284022pdn.3 for ; Sun, 29 Mar 2015 22:24:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=jn+zgRN8AJQJlwQaRSJMGdyjqnHpRCsUCxQ9TN+7IhA=; b=ebrGY6v9fKGepDsht7LZVLNd3hXMncq5BbpkFmNaLO2+UfZ/d5gwnZy7745LbQjBsb Bac0weGEkAlgX+Vn1niAY4t2b/D3RRswA3T1IfZk57k0ekD+k04LNx3H643YbsBBAZbf jg5rUTfCOYAF1Asj/w2oxhJFFa/IRxA5jOefaC0+Ejy50iFaFGjwFPL3gao8Olqm10JC hwbZ15q4uLv2fLeRqJvsvBc4tj74dtBot8xsuWqgnKFYngguFnCxjejgSYnMlEpJVy9X Ar4M0kYUmcVCDf0txYOuh4pzfgzmsmQLbwBW7YNTzAW637exgZN44JbEwSS2Ydlbj0LR hdAw== X-Gm-Message-State: ALoCoQlWfCsxusIbiYQzNX1zbO2h9CzxljbaSfGM5AzvQNVM2Fv4UgHTz0pQoFesotV/+fRB+LSI X-Received: by 10.70.128.67 with SMTP id nm3mr12080446pdb.6.1427693096541; Sun, 29 Mar 2015 22:24:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.195 with SMTP id 61ls2036645qgh.38.gmail; Sun, 29 Mar 2015 22:24:56 -0700 (PDT) X-Received: by 10.140.23.38 with SMTP id 35mr34232473qgo.106.1427693096435; Sun, 29 Mar 2015 22:24:56 -0700 (PDT) Received: from mail-qg0-f50.google.com (mail-qg0-f50.google.com. [209.85.192.50]) by mx.google.com with ESMTPS id l90si9437514qgd.26.2015.03.29.22.24.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Mar 2015 22:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.50 as permitted sender) client-ip=209.85.192.50; Received: by qgf60 with SMTP id 60so160444357qgf.3 for ; Sun, 29 Mar 2015 22:24:56 -0700 (PDT) X-Received: by 10.55.52.77 with SMTP id b74mr6480291qka.78.1427693096333; Sun, 29 Mar 2015 22:24:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.96.155.231 with SMTP id vz7csp1207530qdb; Sun, 29 Mar 2015 22:24:55 -0700 (PDT) X-Received: by 10.70.46.137 with SMTP id v9mr56359755pdm.116.1427693095355; Sun, 29 Mar 2015 22:24:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gz5si12682125pbc.124.2015.03.29.22.24.54; Sun, 29 Mar 2015 22:24:55 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752034AbbC3FYy (ORCPT + 5 others); Mon, 30 Mar 2015 01:24:54 -0400 Received: from mail-yk0-f174.google.com ([209.85.160.174]:35084 "EHLO mail-yk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbbC3FYx (ORCPT ); Mon, 30 Mar 2015 01:24:53 -0400 Received: by ykeg184 with SMTP id g184so6062798yke.2 for ; Sun, 29 Mar 2015 22:24:53 -0700 (PDT) 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 Cc: Leo Yan 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> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leo.yan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , *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; }