From patchwork Mon Apr 21 21:11:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 28722 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CC9D320341 for ; Mon, 21 Apr 2014 21:12:51 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b6sf24935473yha.0 for ; Mon, 21 Apr 2014 14:12:51 -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=ppLA8MZxkEynUr+xn6VZG8xnOr4g6mEBibLXifKpUM8=; b=INMxami9aa3n1SL9FpP7TwTTbhgsX6ruHVHGlQm08o6Ak8nNhHihy9p1Kbtc3C6Z8C Y+ulF32L/+E3/IegJulvfA/XgrtqulKEmCk0p81mlzMZY7r4nlCV0A/YSVqOMsogxkcT pwEr95PjeL2ZrpQwnud0xO5tVx0JAV4PwumQG4BNMNqMrjrj22I4B7bkENFHdiboauwY Dg3/p9JRHrCciloWSXnzog/aI03EiEGeSGo02FoLJsww3TUDfBqWN5TpjCRZXgu2TTdD 3gR2LRZcxodPez96TqFI7luAsdi0WbaLmMI1IdgDSoFvLY0E4svy8gUlIP0pu4J/h+VA 8gWg== X-Gm-Message-State: ALoCoQnQZ7GA3SIlFXq2ok6IpHtzQ6EW8TfYJWVDQ6wMJF19ZRbJswebAqvpC2JjQGZMbWB8f9FL X-Received: by 10.236.231.52 with SMTP id k50mr18063465yhq.52.1398114771304; Mon, 21 Apr 2014 14:12:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.66 with SMTP id g60ls1728937qgf.40.gmail; Mon, 21 Apr 2014 14:12:51 -0700 (PDT) X-Received: by 10.58.46.207 with SMTP id x15mr33442037vem.17.1398114771177; Mon, 21 Apr 2014 14:12:51 -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 la9si6444065veb.200.2014.04.21.14.12.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 14:12:51 -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 lg15so1601862vcb.30 for ; Mon, 21 Apr 2014 14:12:51 -0700 (PDT) X-Received: by 10.58.77.238 with SMTP id v14mr2812469vew.27.1398114771044; Mon, 21 Apr 2014 14:12:51 -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.221.72 with SMTP id ib8csp318809vcb; Mon, 21 Apr 2014 14:12:50 -0700 (PDT) X-Received: by 10.67.4.138 with SMTP id ce10mr40290126pad.12.1398114770018; Mon, 21 Apr 2014 14:12:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sr9si21463668pab.489.2014.04.21.14.12.49; Mon, 21 Apr 2014 14:12:49 -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 S1754639AbaDUVMI (ORCPT + 26 others); Mon, 21 Apr 2014 17:12:08 -0400 Received: from mail-yk0-f177.google.com ([209.85.160.177]:54822 "EHLO mail-yk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754584AbaDUVMB (ORCPT ); Mon, 21 Apr 2014 17:12:01 -0400 Received: by mail-yk0-f177.google.com with SMTP id q200so3860449ykb.36 for ; Mon, 21 Apr 2014 14:12:00 -0700 (PDT) X-Received: by 10.236.230.41 with SMTP id i39mr55828406yhq.14.1398114720478; Mon, 21 Apr 2014 14:12:00 -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 d68sm73391492yhc.37.2014.04.21.14.11.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Apr 2014 14:11:59 -0700 (PDT) From: Alex Elder To: mturquette@linaro.org, mporter@linaro.org, bcm@fixthebug.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 RESEND 2/7] clk: bcm281xx: use init_data.name for clock name Date: Mon, 21 Apr 2014 16:11:38 -0500 Message-Id: <1398114703-32410-3-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1398114703-32410-1-git-send-email-elder@linaro.org> References: <1398114703-32410-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 54a0652..9e7a9c1 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->u.peri; - name = bcm_clk->name; + name = bcm_clk->init_data.name; range = bcm_clk->ccu->range; limit = range - sizeof(u32); @@ -330,7 +330,7 @@ peri_clk_data_valid(struct kona_clk *bcm_clk) return false; peri = bcm_clk->u.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; @@ -631,7 +631,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 4b4e35a..bf0b70e 100644 --- a/drivers/clk/bcm/clk-kona.c +++ b/drivers/clk/bcm/clk-kona.c @@ -809,7 +809,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->u.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) @@ -817,7 +817,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->u.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) @@ -875,12 +875,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; @@ -939,10 +940,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; @@ -964,7 +967,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->u.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 dee6909..1a7eba4 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 {