From patchwork Tue Apr 28 11:31:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ameya Palande X-Patchwork-Id: 20411 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3SBVido002129 for ; Tue, 28 Apr 2009 11:31:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754276AbZD1Lbm (ORCPT ); Tue, 28 Apr 2009 07:31:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754303AbZD1Lbm (ORCPT ); Tue, 28 Apr 2009 07:31:42 -0400 Received: from smtp.nokia.com ([192.100.105.134]:43857 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754276AbZD1Lbm (ORCPT ); Tue, 28 Apr 2009 07:31:42 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n3SBVIrm018294; Tue, 28 Apr 2009 06:31:40 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 28 Apr 2009 14:31:35 +0300 Received: from mgw-int01.ntc.nokia.com ([172.21.143.96]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 28 Apr 2009 14:31:34 +0300 Received: from localhost.localdomain (esdhcp04060.research.nokia.com [172.21.40.60]) by mgw-int01.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n3SBVXFW012891; Tue, 28 Apr 2009 14:31:33 +0300 From: Ameya Palande To: linux-omap@vger.kernel.org Cc: h-kanigeri2@ti.com, x00omar@ti.com Subject: [PATCH][DSPBRIDGE] Add the device after driver initialization Date: Tue, 28 Apr 2009 14:31:43 +0300 Message-Id: <1240918303-16888-1-git-send-email-ameya.palande@nokia.com> X-Mailer: git-send-email 1.6.2.4 X-OriginalArrivalTime: 28 Apr 2009 11:31:34.0770 (UTC) FILETIME=[E2CB6D20:01C9C7F4] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Ameya Palande This prevents a panic caused by an IOCTL call before driver completes its initialization. Signed-off-by: Ameya Palande --- drivers/dsp/bridge/rmgr/drv_interface.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c index 9466409..b562513 100755 --- a/drivers/dsp/bridge/rmgr/drv_interface.c +++ b/drivers/dsp/bridge/rmgr/drv_interface.c @@ -298,14 +298,6 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev) bridge_device->cdev.owner = THIS_MODULE; bridge_device->cdev.ops = &bridge_fops; - status = cdev_add(&bridge_device->cdev, dev, 1); - - if (status) { - GT_0trace(driverTrace, GT_7CLASS, - "Failed to add the bridge device \n"); - return status; - } - /* udev support */ bridge_class = class_create(THIS_MODULE, "ti_bridge"); @@ -429,6 +421,12 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev) } else { GT_0trace(driverTrace, GT_5CLASS, "DSP/BIOS Bridge driver loaded\n"); + /* Announce to kernel that we are ready */ + status = cdev_add(&bridge_device->cdev, dev, 1); + if (status) { + GT_0trace(driverTrace, GT_7CLASS, + "Failed to add the bridge device \n"); + } } }