From patchwork Thu May 29 22:40:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 4267791 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3F8909F1D6 for ; Thu, 29 May 2014 22:43:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AE5720122 for ; Thu, 29 May 2014 22:43:35 +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 7F34F2011B for ; Thu, 29 May 2014 22:43:34 +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 1Wq90u-0008ST-5b; Thu, 29 May 2014 22:41:32 +0000 Received: from mail-oa0-x229.google.com ([2607:f8b0:4003:c02::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wq90f-0008Lt-W3 for linux-arm-kernel@lists.infradead.org; Thu, 29 May 2014 22:41:18 +0000 Received: by mail-oa0-f41.google.com with SMTP id m1so1083731oag.0 for ; Thu, 29 May 2014 15:40:56 -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=SZL9qST1VQWyKmFTX3oMvlaG0s5V3JX+skAZT/LaQYo=; b=l1CG3BKc00pXA5yGVGT+Hu9VgiyO3gNAVFR0reT5+huYOqaNBji4HVa7vcEDlYmWCD KcX4OC3GF32rg3TBmWuGpWVc1qRka7c4s4ppXIJ7r/UuyWGkIzPviIEd7pQB/8ktBcDQ C0skz/q6F/pGXGahzyzlDMzITQ/oVeLlQ713aQnAE1UBxRE/WYFiaAKaZySpro7PIfAZ UFEKHIvArvqX6gW4yqE6uDGnFxQ38JaSLWYY/eMz5GqxqEig9vcSJl8DBZ/7eJjDZd7X mm1YqB0Oba2yzrN3zdJqFT9PD5n1BoSNOAJVsocCTDnUvL8BAkJ1lKPM4MyXHFTMiahO Wb3g== X-Received: by 10.182.144.194 with SMTP id so2mr11987769obb.31.1401403256433; Thu, 29 May 2014 15:40:56 -0700 (PDT) Received: from localhost.localdomain (66-90-144-10.dyn.grandenetworks.net. [66.90.144.10]) by mx.google.com with ESMTPSA id tz6sm3528543obc.10.2014.05.29.15.40.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 May 2014 15:40:55 -0700 (PDT) From: Rob Herring To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH v2 09/11] ARM: timer-sp: allow getting timer1 clock from DT to fallback to legacy clock Date: Thu, 29 May 2014 17:40:19 -0500 Message-Id: <1401403221-27523-10-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401403221-27523-1-git-send-email-robherring2@gmail.com> References: <1401403221-27523-1-git-send-email-robherring2@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140529_154118_086648_DC45CA8A X-CRM114-Status: GOOD ( 14.37 ) X-Spam-Score: 0.1 (/) Cc: Rob Herring , Linus Walleij , arm@kernel.org, Russell King X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: Rob Herring The sp804 clocks may be specified in DT, but the kernel may still be using legacy clocks. This is handled if a single clock for sp804 is present, but not when 3 clocks are present. This prevents Versatile platforms from breaking when the DT has clocks added. Signed-off-by: Rob Herring Cc: Russell King --- v2: - New patch necessary to handle DT with 3 clocks in sp804 node and still use the legacy non-DT clocks. arch/arm/common/timer-sp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c index fd6bff0..1921132 100644 --- a/arch/arm/common/timer-sp.c +++ b/arch/arm/common/timer-sp.c @@ -233,13 +233,13 @@ static void __init sp804_of_init(struct device_node *np) if (IS_ERR(clk1)) clk1 = NULL; - /* Get the 2nd clock if the timer has 2 timer clocks */ + /* Get the 2nd clock if the timer has 3 timer clocks */ if (of_count_phandle_with_args(np, "clocks", "#clock-cells") == 3) { clk2 = of_clk_get(np, 1); if (IS_ERR(clk2)) { pr_err("sp804: %s clock not found: %d\n", np->name, (int)PTR_ERR(clk2)); - goto err; + clk2 = NULL; } } else clk2 = clk1;