From patchwork Tue Mar 23 21:25:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 87772 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2NLQYOA018186 for ; Tue, 23 Mar 2010 21:26:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753677Ab0CWV0d (ORCPT ); Tue, 23 Mar 2010 17:26:33 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:35757 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753524Ab0CWV0d (ORCPT ); Tue, 23 Mar 2010 17:26:33 -0400 Received: by mail-bw0-f209.google.com with SMTP id 1so2292212bwz.21 for ; Tue, 23 Mar 2010 14:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=gLwJT12asbvAgJoIssc/2iqvyhqjNGX+yGLCCZcOYQQ=; b=pZIvgf0ccNJQPTnUIfxb0Av4XWo0BzLJp9vCCHHKX1YUbbSvGhIIpDva7ZxqQDm+XX QwlD/eB7JhCCfe7VUxtk8KkO+XZSACljkrj59fzq6l/ymbUMK3VQPA11JP+M/8062N3G cHTv6fFWFxnvcGbOBpCAiBu/W0KaAs+G5wTkQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=aNGqB4udity6xJUsykPZDYouCP5y86LmDtJ778wn0tTzAP03JEN9zoyQQx5IFAcvpZ CjyPGBofB7Indr9i/flXGXTSC8V2YhDx8s2oAYaGY6+cnoU9mjDqGpRyj1aIjhWPij2d eK2Bt0WiaPae7tVW00shzzz+M7qJYIF8+O8hY= Received: by 10.204.32.196 with SMTP id e4mr809448bkd.131.1269379592357; Tue, 23 Mar 2010 14:26:32 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id 13sm2706355bwz.15.2010.03.23.14.26.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Mar 2010 14:26:31 -0700 (PDT) From: Felipe Contreras To: linux-omap Cc: Ameya Palande , Omar Ramirez Luna , Felipe Contreras Subject: [PATCH 08/10] dsp-bridge: deh: reorganize create() Date: Tue, 23 Mar 2010 23:25:40 +0200 Message-Id: <1269379542-11892-9-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.0.3 In-Reply-To: <1269379542-11892-1-git-send-email-felipe.contreras@gmail.com> References: <1269379542-11892-1-git-send-email-felipe.contreras@gmail.com> 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.3 (demeter.kernel.org [140.211.167.41]); Tue, 23 Mar 2010 21:26:34 +0000 (UTC) diff --git a/arch/arm/plat-omap/include/dspbridge/wmddeh.h b/arch/arm/plat-omap/include/dspbridge/wmddeh.h index e193029..d7b7ee9 100644 --- a/arch/arm/plat-omap/include/dspbridge/wmddeh.h +++ b/arch/arm/plat-omap/include/dspbridge/wmddeh.h @@ -27,7 +27,7 @@ #include -extern dsp_status bridge_deh_create(struct deh_mgr **phDehMgr, +extern dsp_status bridge_deh_create(struct deh_mgr **ret_deh_mgr, struct dev_object *hdev_obj); extern dsp_status bridge_deh_destroy(struct deh_mgr *hdeh_mgr); diff --git a/drivers/dsp/bridge/wmd/ue_deh.c b/drivers/dsp/bridge/wmd/ue_deh.c index 1add675..104ab33 100644 --- a/drivers/dsp/bridge/wmd/ue_deh.c +++ b/drivers/dsp/bridge/wmd/ue_deh.c @@ -62,11 +62,11 @@ static struct hw_mmu_map_attrs_t map_attrs = { static u32 dummy_va_addr; -dsp_status bridge_deh_create(struct deh_mgr **phDehMgr, +dsp_status bridge_deh_create(struct deh_mgr **ret_deh_mgr, struct dev_object *hdev_obj) { dsp_status status = DSP_SOK; - struct deh_mgr *deh_mgr_obj = NULL; + struct deh_mgr *deh_mgr_obj; struct cfg_hostres cfg_host_res; struct cfg_devnode *dev_node_obj; struct wmd_dev_context *hwmd_context = NULL; @@ -83,7 +83,7 @@ dsp_status bridge_deh_create(struct deh_mgr **phDehMgr, dummy_va_addr = 0; /* Allocate IO manager object: */ MEM_ALLOC_OBJECT(deh_mgr_obj, struct deh_mgr, SIGNATURE); - if (deh_mgr_obj == NULL) { + if (!deh_mgr_obj) { status = DSP_EMEMORY; goto leave; } @@ -96,17 +96,17 @@ dsp_status bridge_deh_create(struct deh_mgr **phDehMgr, (u32) deh_mgr_obj); if (DSP_FAILED(status)) - goto leave; + goto err; status = dev_get_dev_node(hdev_obj, &dev_node_obj); if (DSP_FAILED(status)) - goto leave; + goto err; status = cfg_get_host_resources(dev_node_obj, &cfg_host_res); if (DSP_FAILED(status)) - goto leave; + goto err; /* Fill in context structure */ deh_mgr_obj->hwmd_context = hwmd_context; @@ -114,6 +114,7 @@ dsp_status bridge_deh_create(struct deh_mgr **phDehMgr, deh_mgr_obj->err_info.dw_val1 = 0L; deh_mgr_obj->err_info.dw_val2 = 0L; deh_mgr_obj->err_info.dw_val3 = 0L; + /* Install ISR function for DSP MMU fault */ if ((request_irq(INT_DSP_MMU_IRQ, mmu_fault_isr, 0, "DspBridge\tiommu fault", @@ -122,15 +123,16 @@ dsp_status bridge_deh_create(struct deh_mgr **phDehMgr, else status = DSP_EFAIL; -leave: +err: if (DSP_FAILED(status)) { /* If create failed, cleanup */ bridge_deh_destroy((struct deh_mgr *)deh_mgr_obj); - *phDehMgr = NULL; - } else { - *phDehMgr = (struct deh_mgr *)deh_mgr_obj; + deh_mgr_obj = NULL; } +leave: + *ret_deh_mgr = deh_mgr_obj; + return status; }