From patchwork Fri Jun 24 11:05:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Cousson X-Patchwork-Id: 915772 X-Patchwork-Delegate: b-cousson@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5OB6HgM010552 for ; Fri, 24 Jun 2011 11:06:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754834Ab1FXLGX (ORCPT ); Fri, 24 Jun 2011 07:06:23 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:47744 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754779Ab1FXLGW (ORCPT ); Fri, 24 Jun 2011 07:06:22 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p5OB6KqU010172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jun 2011 06:06:20 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep34.itg.ti.com (8.13.7/8.13.8) with ESMTP id p5OB6KeH000233; Fri, 24 Jun 2011 06:06:20 -0500 (CDT) Received: from dlee73.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5OB6KCY006037; Fri, 24 Jun 2011 06:06:20 -0500 (CDT) Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE73.ent.ti.com (157.170.170.88) with Microsoft SMTP Server id 8.3.106.1; Fri, 24 Jun 2011 06:06:20 -0500 Received: from localhost.localdomain (lncpu04.tif.ti.com [137.167.102.15]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5OB62us024325; Fri, 24 Jun 2011 06:06:19 -0500 From: Benoit Cousson To: CC: rnayak@ti.com, santosh.shilimkar@ti.com, linux-omap@vger.kernel.org, Benoit Cousson Subject: [PATCH 05/14] OMAP2+: hwmod: Replace clkdm access from main_clk using hwmod attribute Date: Fri, 24 Jun 2011 13:05:51 +0200 Message-ID: <1308913560-333-6-git-send-email-b-cousson@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 24 Jun 2011 11:06:24 +0000 (UTC) Since the clkdm is now part of the omap_hwmod structure, there is no need to retrieve it from the main_clock or interface clock. The code can be simplified a little bit with a direct access. Signed-off-by: Benoit Cousson Cc: Paul Walmsley Cc: Rajendra Nayak --- arch/arm/mach-omap2/omap_hwmod.c | 34 ++++++++-------------------------- 1 files changed, 8 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 617ad21..8ac2546 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -463,13 +463,13 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v) */ static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) { - if (!oh->_clk) + if (!oh->clkdm) return -EINVAL; - if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS) + if (oh->clkdm->flags & CLKDM_NO_AUTODEPS) return 0; - return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); + return clkdm_add_sleepdep(oh->clkdm, init_oh->clkdm); } /** @@ -487,13 +487,13 @@ static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) */ static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) { - if (!oh->_clk) + if (!oh->clkdm) return -EINVAL; - if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS) + if (oh->clkdm->flags & CLKDM_NO_AUTODEPS) return 0; - return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); + return clkdm_del_sleepdep(oh->clkdm, init_oh->clkdm); } /** @@ -518,10 +518,6 @@ static int _init_main_clk(struct omap_hwmod *oh) return -EINVAL; } - if (!oh->_clk->clkdm) - pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n", - oh->main_clk, oh->_clk->name); - return ret; } @@ -2104,24 +2100,10 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) */ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh) { - struct clk *c; - - if (!oh) + if (!oh || !oh->clkdm) return NULL; - if (oh->_clk) { - c = oh->_clk; - } else { - if (oh->_int_flags & _HWMOD_NO_MPU_PORT) - return NULL; - c = oh->slaves[oh->_mpu_port_index]->_clk; - } - - if (!c->clkdm) - return NULL; - - return c->clkdm->pwrdm.ptr; - + return oh->clkdm->pwrdm.ptr; } /**