From patchwork Wed Jun 9 00:48:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: omar ramirez X-Patchwork-Id: 105061 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 o590tWFY008027 for ; Wed, 9 Jun 2010 00:55:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756717Ab0FIAzc (ORCPT ); Tue, 8 Jun 2010 20:55:32 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:49466 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756497Ab0FIAzc (ORCPT ); Tue, 8 Jun 2010 20:55:32 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o590tSSt032446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Jun 2010 19:55:28 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o590tR9g026728; Tue, 8 Jun 2010 19:55:27 -0500 (CDT) Received: from localhost (bacab.am.dhcp.ti.com [128.247.77.143]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o590tRP21211; Tue, 8 Jun 2010 19:55:27 -0500 (CDT) From: Omar Ramirez Luna To: linux-omap Cc: Ameya Palande , Hiroshi Doyu , Felipe Contreras , Nishanth Menon , Omar Ramirez Luna Subject: [PATCH 2/2] DSPBRIDGE: reorganize probe function Date: Tue, 8 Jun 2010 19:48:13 -0500 Message-Id: <1276044493-23003-3-git-send-email-omar.ramirez@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1276044493-23003-1-git-send-email-omar.ramirez@ti.com> References: <1276044493-23003-1-git-send-email-omar.ramirez@ti.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]); Wed, 09 Jun 2010 00:55:35 +0000 (UTC) diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c index f80b15b..16a74c4 100644 --- a/drivers/dsp/bridge/rmgr/drv_interface.c +++ b/drivers/dsp/bridge/rmgr/drv_interface.c @@ -335,9 +335,8 @@ err1: static int __devinit omap34_xx_bridge_probe(struct platform_device *pdev) { - int status; + int err; dev_t dev = 0; - int result; #ifdef CONFIG_BRIDGE_DVFS int i = 0; #endif @@ -348,43 +347,46 @@ static int __devinit omap34_xx_bridge_probe(struct platform_device *pdev) bridge = &omap_dspbridge_dev->dev; /* Bridge low level initializations */ - status = omap3_bridge_startup(pdev); - if (status) + err = omap3_bridge_startup(pdev); + if (err) goto err1; /* use 2.6 device model */ - result = alloc_chrdev_region(&dev, 0, 1, driver_name); - if (result < 0) { + err = alloc_chrdev_region(&dev, 0, 1, driver_name); + if (err) { pr_err("%s: Can't get major %d\n", __func__, driver_major); goto err1; } - driver_major = MAJOR(dev); - cdev_init(&bridge_cdev, &bridge_fops); bridge_cdev.owner = THIS_MODULE; - status = cdev_add(&bridge_cdev, dev, 1); - if (status) { + err = cdev_add(&bridge_cdev, dev, 1); + if (err) { pr_err("%s: Failed to add bridge device\n", __func__); goto err2; } /* udev support */ bridge_class = class_create(THIS_MODULE, "ti_bridge"); - - if (IS_ERR(bridge_class)) + if (IS_ERR(bridge_class)) { pr_err("%s: Error creating bridge class\n", __func__); + goto err3; + } + driver_major = MAJOR(dev); device_create(bridge_class, NULL, MKDEV(driver_major, 0), NULL, "DspBridge"); + pr_info("DSP Bridge driver loaded\n"); return 0; +err3: + cdev_del(&bridge_cdev); err2: unregister_chrdev_region(dev, 1); err1: - return result; + return err; } static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev)