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: 51819 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 020D5229FD for ; Mon, 3 Aug 2015 01:15:24 +0000 (UTC) Received: by labth1 with SMTP id th1sf15338999lab.2 for ; Sun, 02 Aug 2015 18:15:22 -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=Nz+toulgaGNxAz0fhzdBqq2itOdWy6R04630SA4qswA=; b=hNyM9SHWdBVzponigYcz9cbz7gMfWrvwH3nxgdL5zFZ1BqSjfUB5oSQScy3yCu1zQS JjipmJxWLOdxxLmQKmNxGkUqJSdFMYltnodtLVizfFH7JO1fQrzPXC6x6BLrQTb/WHh0 vgJ4obb7r6NRg23CXTAj1rWG5/D93kJbh1VTSSmIBzIBdMnDPnGDLMh/dbX3rNCAmmPh h5oK7b3h3AFbVR0Mrf+KjHV6dQXD9dYaVHmndkIvZmOQYWF2bX9hcDIljANmc1HeFW4g rXDG/x/wy4QYNgJTrn/mzEsftlvOs7aFGpaNkXcO6A93GEOO3G+fIKh37TA9Dh4BA1fS YpeA== X-Gm-Message-State: ALoCoQlHQK5ZHNTpCB6gjwy2FOPT6bZ/Xjt4H8wPwD2JnS2Daa4ievz66ybVZ/5rkPXxhXYop2f6 X-Received: by 10.112.160.39 with SMTP id xh7mr4768650lbb.22.1438564522646; Sun, 02 Aug 2015 18:15:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.163 with SMTP id c3ls426188laa.98.gmail; Sun, 02 Aug 2015 18:15:22 -0700 (PDT) X-Received: by 10.112.133.72 with SMTP id pa8mr14241246lbb.117.1438564522400; Sun, 02 Aug 2015 18:15:22 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id xi9si10657251lbb.4.2015.08.02.18.15.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 18:15:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbud7 with SMTP id ud7so66056979lbb.3 for ; Sun, 02 Aug 2015 18:15:22 -0700 (PDT) X-Received: by 10.112.161.197 with SMTP id xu5mr14246252lbb.69.1438564522257; Sun, 02 Aug 2015 18:15:22 -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.112.7.198 with SMTP id l6csp1597140lba; Sun, 2 Aug 2015 18:15:21 -0700 (PDT) X-Received: by 10.68.88.69 with SMTP id be5mr18434665pbb.105.1438564520393; Sun, 02 Aug 2015 18:15:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl5si10014788pbb.242.2015.08.02.18.15.19; Sun, 02 Aug 2015 18:15:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558AbbHCBPN (ORCPT + 28 others); Sun, 2 Aug 2015 21:15:13 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34146 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752476AbbHCBPH (ORCPT ); Sun, 2 Aug 2015 21:15:07 -0400 Received: by pacan13 with SMTP id an13so77669261pac.1 for ; Sun, 02 Aug 2015 18:15:07 -0700 (PDT) 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 Cc: Leo Yan 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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.217.176 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 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; }