From patchwork Fri Jul 1 21:09:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Cousson X-Patchwork-Id: 938382 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 p61LTcRQ014702 for ; Fri, 1 Jul 2011 21:49:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756640Ab1GAVJl (ORCPT ); Fri, 1 Jul 2011 17:09:41 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:58888 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756361Ab1GAVJk (ORCPT ); Fri, 1 Jul 2011 17:09:40 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p61L9XDR032613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Jul 2011 16:09:34 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep35.itg.ti.com (8.13.7/8.13.8) with ESMTP id p61L9X5k008405; Fri, 1 Jul 2011 16:09:33 -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 p61L9X09012830; Fri, 1 Jul 2011 16:09:33 -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, 1 Jul 2011 16:09:33 -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 p61L9ORK016360; Fri, 1 Jul 2011 16:09:32 -0500 From: Benoit Cousson To: CC: rnayak@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Benoit Cousson Subject: [PATCH v3 05/13] OMAP2+: hwmod: Replace clkdm access from main_clk using hwmod attribute Date: Fri, 1 Jul 2011 23:09:10 +0200 Message-ID: <1309554558-19819-6-git-send-email-b-cousson@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1309554558-19819-1-git-send-email-b-cousson@ti.com> References: <1309554558-19819-1-git-send-email-b-cousson@ti.com> 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, 01 Jul 2011 21:49:08 +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 b54e1e6..fdf6547 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; } @@ -2108,24 +2104,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; } /**