From patchwork Wed Apr 2 02:04:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 27590 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB3DB20341 for ; Wed, 2 Apr 2014 02:05:13 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf27096839pdb.5 for ; Tue, 01 Apr 2014 19:05:12 -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=p7NHTh4wbdEvWvPB2rdr7CU+BSK86dS6ZawM+srDOsY=; b=RFoI+3K8cy3MRWu4DTPse/zhOwCw4n2i3HUda+J7t+xy9gJTgnmd3kZ86EkXTZNrfb P6snS2N/FflWdM2ttP/ErpUpUJ93CaYhD3r+FiDQzWvElxmow0CEvIeq92ba7BfT7qpR Eje8NwBflR0IvpcSxWEa5l++ckb2k6pcw3cTz08lLOh8nktMyoPS/fJTFRlNDhSzaoKQ evjrwBHEZPietLMbcD8dbkKZQVSeHYYfzeTR687urDOmn5xxxAgjmb+Sr311KPrIlk3U 0kU103VMwR2V9Sb8vd8REnoO2EstLfVRJgRy9p1ySBRh00td9hUKtFFsZvYI8ajpAOfz HZxA== X-Gm-Message-State: ALoCoQmRsnFCIf3VzTEXq+QJBSWIzP9T1Wu9IKYJos4J7WAuzQCmSJuyf3vfh6xK7zHjVVgYNPe2 X-Received: by 10.67.2.101 with SMTP id bn5mr13579600pad.29.1396404312851; Tue, 01 Apr 2014 19:05:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.66 with SMTP id e60ls84610qge.51.gmail; Tue, 01 Apr 2014 19:05:12 -0700 (PDT) X-Received: by 10.52.163.145 with SMTP id yi17mr1121648vdb.46.1396404312731; Tue, 01 Apr 2014 19:05:12 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id wy9si151351vdc.145.2014.04.01.19.05.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 19:05:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id lg15so10789627vcb.2 for ; Tue, 01 Apr 2014 19:05:12 -0700 (PDT) X-Received: by 10.52.65.165 with SMTP id y5mr135967vds.51.1396404312618; Tue, 01 Apr 2014 19:05:12 -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.220.12.8 with SMTP id v8csp284990vcv; Tue, 1 Apr 2014 19:05:12 -0700 (PDT) X-Received: by 10.66.49.74 with SMTP id s10mr34790308pan.0.1396404311835; Tue, 01 Apr 2014 19:05:11 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dj5si240533pad.205.2014.04.01.19.05.11; Tue, 01 Apr 2014 19:05:11 -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 S932087AbaDBCEo (ORCPT + 27 others); Tue, 1 Apr 2014 22:04:44 -0400 Received: from mail-ig0-f169.google.com ([209.85.213.169]:47560 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751707AbaDBCEf (ORCPT ); Tue, 1 Apr 2014 22:04:35 -0400 Received: by mail-ig0-f169.google.com with SMTP id h18so5390438igc.2 for ; Tue, 01 Apr 2014 19:04:34 -0700 (PDT) X-Received: by 10.50.73.104 with SMTP id k8mr1065571igv.33.1396404274549; Tue, 01 Apr 2014 19:04:34 -0700 (PDT) Received: from localhost.localdomain (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id vu3sm1909156igc.6.2014.04.01.19.04.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 19:04:34 -0700 (PDT) From: Alex Elder To: mturquette@linaro.org, bcm@fixthebug.org, mporter@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/7] clk: bcm281xx: use init_data.name for clock name Date: Tue, 1 Apr 2014 21:04:50 -0500 Message-Id: <1396404296-9390-3-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396404296-9390-1-git-send-email-elder@linaro.org> References: <1396404296-9390-1-git-send-email-elder@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: elder@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , Use the init_data.name field to hold the name of a Kona clock rather than duplicating it. Signed-off-by: Alex Elder --- drivers/clk/bcm/clk-kona-setup.c | 6 +++--- drivers/clk/bcm/clk-kona.c | 17 ++++++++++------- drivers/clk/bcm/clk-kona.h | 3 +-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/clk/bcm/clk-kona-setup.c b/drivers/clk/bcm/clk-kona-setup.c index c7607fe..eed84f5 100644 --- a/drivers/clk/bcm/clk-kona-setup.c +++ b/drivers/clk/bcm/clk-kona-setup.c @@ -64,7 +64,7 @@ static bool peri_clk_data_offsets_valid(struct kona_clk *bcm_clk) BUG_ON(bcm_clk->type != bcm_clk_peri); peri = bcm_clk->peri; - name = bcm_clk->name; + name = bcm_clk->init_data.name; range = bcm_clk->ccu->range; limit = range - sizeof(u32); @@ -329,7 +329,7 @@ peri_clk_data_valid(struct kona_clk *bcm_clk) return false; peri = bcm_clk->peri; - name = bcm_clk->name; + name = bcm_clk->init_data.name; gate = &peri->gate; if (gate_exists(gate) && !gate_valid(gate, "gate", name)) return false; @@ -630,7 +630,7 @@ struct clk *kona_clk_setup(struct ccu_data *ccu, const char *name, return NULL; } bcm_clk->ccu = ccu; - bcm_clk->name = name; + bcm_clk->init_data.name = name; init_data = &bcm_clk->init_data; init_data->name = name; diff --git a/drivers/clk/bcm/clk-kona.c b/drivers/clk/bcm/clk-kona.c index c01d810..488ed1f 100644 --- a/drivers/clk/bcm/clk-kona.c +++ b/drivers/clk/bcm/clk-kona.c @@ -807,7 +807,7 @@ static int kona_peri_clk_enable(struct clk_hw *hw) struct kona_clk *bcm_clk = to_kona_clk(hw); struct bcm_clk_gate *gate = &bcm_clk->peri->gate; - return clk_gate(bcm_clk->ccu, bcm_clk->name, gate, true); + return clk_gate(bcm_clk->ccu, bcm_clk->init_data.name, gate, true); } static void kona_peri_clk_disable(struct clk_hw *hw) @@ -815,7 +815,7 @@ static void kona_peri_clk_disable(struct clk_hw *hw) struct kona_clk *bcm_clk = to_kona_clk(hw); struct bcm_clk_gate *gate = &bcm_clk->peri->gate; - (void)clk_gate(bcm_clk->ccu, bcm_clk->name, gate, false); + (void)clk_gate(bcm_clk->ccu, bcm_clk->init_data.name, gate, false); } static int kona_peri_clk_is_enabled(struct clk_hw *hw) @@ -873,12 +873,13 @@ static int kona_peri_clk_set_parent(struct clk_hw *hw, u8 index) ret = selector_write(bcm_clk->ccu, &data->gate, sel, trig, index); if (ret == -ENXIO) { - pr_err("%s: gating failure for %s\n", __func__, bcm_clk->name); + pr_err("%s: gating failure for %s\n", __func__, + bcm_clk->init_data.name); ret = -EIO; /* Don't proliferate weird errors */ } else if (ret == -EIO) { pr_err("%s: %strigger failed for %s\n", __func__, trig == &data->pre_trig ? "pre-" : "", - bcm_clk->name); + bcm_clk->init_data.name); } return ret; @@ -937,10 +938,12 @@ static int kona_peri_clk_set_rate(struct clk_hw *hw, unsigned long rate, ret = divider_write(bcm_clk->ccu, &data->gate, &data->div, &data->trig, scaled_div); if (ret == -ENXIO) { - pr_err("%s: gating failure for %s\n", __func__, bcm_clk->name); + pr_err("%s: gating failure for %s\n", __func__, + bcm_clk->init_data.name); ret = -EIO; /* Don't proliferate weird errors */ } else if (ret == -EIO) { - pr_err("%s: trigger failed for %s\n", __func__, bcm_clk->name); + pr_err("%s: trigger failed for %s\n", __func__, + bcm_clk->init_data.name); } return ret; @@ -962,7 +965,7 @@ static bool __peri_clk_init(struct kona_clk *bcm_clk) { struct ccu_data *ccu = bcm_clk->ccu; struct peri_clk_data *peri = bcm_clk->peri; - const char *name = bcm_clk->name; + const char *name = bcm_clk->init_data.name; struct bcm_clk_trig *trig; BUG_ON(bcm_clk->type != bcm_clk_peri); diff --git a/drivers/clk/bcm/clk-kona.h b/drivers/clk/bcm/clk-kona.h index 5e139ad..96fd0bc 100644 --- a/drivers/clk/bcm/clk-kona.h +++ b/drivers/clk/bcm/clk-kona.h @@ -373,8 +373,7 @@ struct peri_clk_data { struct kona_clk { struct clk_hw hw; - struct clk_init_data init_data; - const char *name; /* name of this clock */ + struct clk_init_data init_data; /* includes name of this clock */ struct ccu_data *ccu; /* ccu this clock is associated with */ enum bcm_clk_type type; union {