From patchwork Thu Oct 1 19:32:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 54402 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 31B2F2301B for ; Thu, 1 Oct 2015 19:33:17 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf982385wic.1 for ; Thu, 01 Oct 2015 12:33:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=X9kNqp7Fyoi2VCeLfR6h3aojN9GHaXh28jX9pmyWYjY=; b=ZpYHymGwQVpAUOH3YV0mYFkiOCNvamZkaMrr8IpuC43EPFkLMOW/RMtMGmge2n+LMU Rw7OLwyUehqiMDIkF/J1etjRcWyAT2w0bWsnSHPVGy3Yfd+rHGx55kD3jzGF+qd+RNC2 FvRJgFhMlQ6ikkChcI4/KSd72CvwI7Oaxu1jMPOa+55bPlsZGG1IP1djEfOjSJs70QUz 3QK/Oi0HOjT3B3XsRwqt/XwBNtRFxdS7KXq5JmYD0G0cV8YGntGT4WdAAQaV/PYHEOCm gktRyCxGPaSeuKeEGzRh5GhbiwF6PmCHfTDaH1vnvtVmYFseWprQn8reaA/j8pYM9fBU 9nfw== X-Gm-Message-State: ALoCoQlauGw8DuDk5KXsi48sV3lerno1HYK2DkxdKMHzH5ZjdjC0zac8DyH/LXvwXQkumfY1Y/iQ X-Received: by 10.112.55.69 with SMTP id q5mr1745485lbp.24.1443727996449; Thu, 01 Oct 2015 12:33:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.81.148 with SMTP id f142ls131038lfb.68.gmail; Thu, 01 Oct 2015 12:33:16 -0700 (PDT) X-Received: by 10.112.16.199 with SMTP id i7mr3676340lbd.105.1443727996170; Thu, 01 Oct 2015 12:33:16 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id k5si3713868lfg.108.2015.10.01.12.33.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2015 12:33:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by laclj5 with SMTP id lj5so80961819lac.3 for ; Thu, 01 Oct 2015 12:33:15 -0700 (PDT) X-Received: by 10.112.64.72 with SMTP id m8mr3626103lbs.41.1443727995846; Thu, 01 Oct 2015 12:33:15 -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.59.35 with SMTP id w3csp794912lbq; Thu, 1 Oct 2015 12:33:15 -0700 (PDT) X-Received: by 10.50.39.6 with SMTP id l6mr639720igk.55.1443727993909; Thu, 01 Oct 2015 12:33:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i192si6114380ioe.47.2015.10.01.12.33.13; Thu, 01 Oct 2015 12:33:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 S1750923AbbJATdM (ORCPT + 7 others); Thu, 1 Oct 2015 15:33:12 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:55386 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751123AbbJATdK (ORCPT ); Thu, 1 Oct 2015 15:33:10 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t91JWhQS017695; Thu, 1 Oct 2015 14:32:43 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t91JWhRk029083; Thu, 1 Oct 2015 14:32:43 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Thu, 1 Oct 2015 14:32:43 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t91JWgnB005429; Thu, 1 Oct 2015 14:32:42 -0500 Received: from localhost (irmo.am.dhcp.ti.com [128.247.9.166]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id t91JWg902269; Thu, 1 Oct 2015 14:32:42 -0500 (CDT) From: Suman Anna To: Tony Lindgren CC: Paul Walmsley , , , , Suman Anna Subject: [PATCH 1/4] ARM: OMAP: dmtimer: check for fixed timers during config Date: Thu, 1 Oct 2015 14:32:37 -0500 Message-ID: <1443727960-32232-2-git-send-email-s-anna@ti.com> X-Mailer: git-send-email 2.6.0 In-Reply-To: <1443727960-32232-1-git-send-email-s-anna@ti.com> References: <1443727960-32232-1-git-send-email-s-anna@ti.com> MIME-Version: 1.0 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: s-anna@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mailfrom=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: , The omap_dm_timer_set_source() function provides a means for client users to configure the mux parent for a GPTimer's functional clock. However, not all timers are configurable (Eg: Timer12 on DRA7 is fed by an internal 32k oscillator clock, and does not have configurable parent clocks). So, check for such cases and proceed with out throwing an error. Signed-off-by: Suman Anna --- arch/arm/plat-omap/dmtimer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 8ca94d379bc3..25693e722f1f 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -36,6 +36,7 @@ */ #include +#include #include #include #include @@ -504,6 +505,10 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) if (IS_ERR(timer->fclk)) return -EINVAL; + /* Check if the clock has parents if not no point checking */ + if (!clk_hw_get_num_parents(__clk_get_hw(timer->fclk))) + return 0; + switch (source) { case OMAP_TIMER_SRC_SYS_CLK: parent_name = "timer_sys_ck";