From patchwork Tue Jul 18 10:17:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 9847661 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 8529B602C8 for ; Tue, 18 Jul 2017 10:32:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B2B42853A for ; Tue, 18 Jul 2017 10:32:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FFAD2854A; Tue, 18 Jul 2017 10:32:42 +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.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham 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 0027B2853A for ; Tue, 18 Jul 2017 10:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hV3nxnjm0awc8bSoBHXQnYaPnOY/+xrOP1zjL+sEtB4=; b=pSo+Scw7Rp+xZ6ATQ8fFSHv6RV gp0A9VqB4m9Db5jX1DWdRS1BkUubh87PfvgsPamapRyrh/1vikswT5DeHcDhqzwRdAYbdaeX5XbvE P7Wbhj5w5fDxxCsNJuQ9Pun9EkzWMh+jw6h5aTS47TXR7f75UTJ1ijxxJJaIIq7Mh0BiJ/UmU4Svh 2kLnBCiwgbP1NOEtbuji+Og0gNEPMsS+VpVdlmL4Dk0ck8wwxTLZOsWBY9LdhicDBAVITC3O1zkIQ SKG1YG3vZ/YcAzMiPL2umUQAgukGNBzbQJE9p3vh+pbsQKE5tQjiqBJ5wrD+bEmx7chCkJfobK9Jg 4buqAGSg==; 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 1dXPnr-0004Xt-MS; Tue, 18 Jul 2017 10:32:31 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXPZq-0005q5-Nr for linux-arm-kernel@lists.infradead.org; Tue, 18 Jul 2017 10:18:06 +0000 Received: by mail-wr0-x244.google.com with SMTP id w4so3630831wrb.1 for ; Tue, 18 Jul 2017 03:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IaC2RrF27xLKmexITqdzCshPhUvnSWADk1kc1iUlLdo=; b=j1AMYROC8PGpqwbIzjY7pu4899G7YsOIR7TYxrK7chQ4cR4f32TGXI/sfqll0jHA7x 8MQngLHWQR29tVspnRxi1AdZ3SkfmtfjHw4X8Q1pwE8ZZmS/hqF7XFulppZ6wbO7bZpm JtuoBmE+Wf9O2L5U7RYzdCow6v8rp1WKe39zGs1EWJHFbPsR/HZONzou9kUfzXs37w3P MfMuKT/lvvkQkg9NIxK+IwdjWtKpKi5JLCWWu+RznXPavLETqHEH2kIY0mvUMDrrF+zm IhUaNcIDJUdWHm1lbBl4ZyR2NFTgZ0h7WwTPGP8cJlgcOlZmqSjVtPqw60kmvATzrx3j L2KA== 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=IaC2RrF27xLKmexITqdzCshPhUvnSWADk1kc1iUlLdo=; b=aOQteVQQq4IN1fHPB8xz9R1Y4Ym0m+/FBsoLjjuFPRtDHO4jVEiJp3kXauLVNQ7ySW kHBfBmeSY9WDNBaPlBr6wWJw8ij68Pe5X6r+UPBrUYYdy4FN/qNZ+OGIV/PCDxOKBmRX bz1E39M9U7VC+hjAtKg5jRzzh9RKwyVJDXQt0+CPRL1pmnI5m59bo2gvGIQsQbLQOCKl pn02HufU9HQiwPMzvv+3SlGR8bmKQ23k9fBb1eg1H4yw3lymkG+sZLA6FUX8oxEcFeGQ QJ+Xq53QzZDHPI+kdIeNkbPlUEijL+0kedUm7tx3C8ciyo2/BjCrZds0Q7IhwvAf2Idk ps+w== X-Gm-Message-State: AIVw113jfRfTVgtZsNUBHYwZm0RojIVX0V37E1cqvlOTQLpLztDgDJZD GRHfd/HMVNe0Hw== X-Received: by 10.28.134.72 with SMTP id i69mr542115wmd.0.1500373060901; Tue, 18 Jul 2017 03:17:40 -0700 (PDT) Received: from localhost.localdomain ([2001:470:9e39::48e]) by smtp.gmail.com with ESMTPSA id 9sm3253728wml.25.2017.07.18.03.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 03:17:40 -0700 (PDT) From: Jonas Gorski To: Subject: [PATCH 1/9] ARM: ep93xx: allow NULL clock for clk_get_rate Date: Tue, 18 Jul 2017 12:17:22 +0200 Message-Id: <20170718101730.2541-2-jonas.gorski@gmail.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170718101730.2541-1-jonas.gorski@gmail.com> References: <20170718101730.2541-1-jonas.gorski@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170718_031803_011100_05165BB0 X-CRM114-Status: GOOD ( 10.75 ) 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: Hartley Sweeten , Alexander Sverdlin , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 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 Make the behaviour of clk_get_rate consistent with common clk's clk_get_rate by accepting NULL clocks as parameter. Some device drivers rely on this, and will cause an OOPS otherwise. Fixes: 1d81eedb8f6c ("[ARM] 3634/1: ep93xx: initial implementation of the clk_* API") Cc: Hartley Sweeten Cc: Alexander Sverdlin Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reported-by: Mathias Kresin Signed-off-by: Jonas Gorski Acked-by: Alexander Sverdlin --- arch/arm/mach-ep93xx/clock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 39ef3b613912..f0768befafe8 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c @@ -316,6 +316,9 @@ static unsigned long get_uart_rate(struct clk *clk) unsigned long clk_get_rate(struct clk *clk) { + if (!clk) + return 0; + if (clk->get_rate) return clk->get_rate(clk);