From patchwork Mon Feb 1 19:00:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ameya Palande X-Patchwork-Id: 76145 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 o11J0xxe026352 for ; Mon, 1 Feb 2010 19:01:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755619Ab0BATA7 (ORCPT ); Mon, 1 Feb 2010 14:00:59 -0500 Received: from smtp.nokia.com ([192.100.122.233]:44174 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755400Ab0BATA6 (ORCPT ); Mon, 1 Feb 2010 14:00:58 -0500 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o11J0eXS003233; Mon, 1 Feb 2010 21:00:51 +0200 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 1 Feb 2010 21:00:36 +0200 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 1 Feb 2010 21:00:36 +0200 Received: from localhost.localdomain (esdhcp041217.research.nokia.com [172.21.41.217]) by mgw-sa02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o11J0Y7J010889; Mon, 1 Feb 2010 21:00:35 +0200 From: Ameya Palande To: omar.ramirez@ti.com Cc: nm@ti.com, linux-omap@vger.kernel.org, deepak.chitriki@ti.com Subject: [PATCH] DSPBRIDGE: Get rid of bridge_dev and bridge_device pointer Date: Mon, 1 Feb 2010 21:00:16 +0200 Message-Id: <8b0800ea64a6f9cced4d0b3e1c0771b2a5cc6993.1265050008.git.ameya.palande@nokia.com> X-Mailer: git-send-email 1.6.3.3 X-OriginalArrivalTime: 01 Feb 2010 19:00:36.0459 (UTC) FILETIME=[D68B2BB0:01CAA370] X-Nokia-AV: Clean 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]); Mon, 01 Feb 2010 19:01:00 +0000 (UTC) diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c index de79f26..d745b45 100644 --- a/drivers/dsp/bridge/rmgr/drv_interface.c +++ b/drivers/dsp/bridge/rmgr/drv_interface.c @@ -80,11 +80,8 @@ struct platform_device *omap_dspbridge_dev; /* This is a test variable used by Bridge to test different sleep states */ s32 dsp_test_sleepstate; -struct bridge_dev { - struct cdev cdev; -}; -static struct bridge_dev *bridge_device; +static struct cdev bridge_cdev; static struct class *bridge_class; @@ -244,20 +241,14 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev) driver_major = MAJOR(dev); - bridge_device = kzalloc(sizeof(struct bridge_dev), GFP_KERNEL); - if (!bridge_device) { - result = -ENOMEM; - goto err2; - } - cdev_init(&bridge_device->cdev, &bridge_fops); - bridge_device->cdev.owner = THIS_MODULE; - bridge_device->cdev.ops = &bridge_fops; + cdev_init(&bridge_cdev, &bridge_fops); + bridge_cdev.owner = THIS_MODULE; - status = cdev_add(&bridge_device->cdev, dev, 1); + status = cdev_add(&bridge_cdev, dev, 1); if (status) { GT_0trace(driverTrace, GT_7CLASS, "Failed to add the bridge device \n"); - goto err3; + goto err2; } /* udev support */ @@ -376,12 +367,8 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev) return 0; -err3: - kfree(bridge_device); - err2: unregister_chrdev_region(dev, 1); - err1: return result; } @@ -428,10 +415,7 @@ func_cont: GT_exit(); devno = MKDEV(driver_major, 0); - if (bridge_device) { - cdev_del(&bridge_device->cdev); - kfree(bridge_device); - } + cdev_del(&bridge_cdev); unregister_chrdev_region(devno, 1); if (bridge_class) { /* remove the device from sysfs */