From: Omar Ramirez Luna <omar.ramirez@ti.com>
To: linux-omap <linux-omap@vger.kernel.org>
Cc: Ameya Palande <ameya.palande@nokia.com>,
Hiroshi Doyu <Hiroshi.DOYU@nokia.com>,
Felipe Contreras <felipe.contreras@nokia.com>,
Nishanth Menon <nm@ti.com>,
Omar Ramirez Luna <omar.ramirez@ti.com>
Subject: [PATCH 2/2] DSPBRIDGE: reorganize probe function
Date: Tue, 8 Jun 2010 19:48:13 -0500 [thread overview]
Message-ID: <1276044493-23003-3-git-send-email-omar.ramirez@ti.com> (raw)
In-Reply-To: <1276044493-23003-1-git-send-email-omar.ramirez@ti.com>
Renaming and deleting unused variables, few enhancement on
error path.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
drivers/dsp/bridge/rmgr/drv_interface.c | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
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)
--
1.7.1
next prev parent reply other threads:[~2010-06-09 0:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-09 0:48 [PATCH 0/2] dspbridge: reorganize initialization and probe Omar Ramirez Luna
2010-06-09 0:48 ` [PATCH 1/2] DSPRBIDGE: split probe from bridge initializations Omar Ramirez Luna
2010-06-09 0:48 ` Omar Ramirez Luna [this message]
2010-06-09 7:25 ` [PATCH 0/2] dspbridge: reorganize initialization and probe Felipe Contreras
2010-06-09 8:49 ` Ameya Palande
2010-06-09 9:28 ` Felipe Contreras
2010-06-14 17:59 ` Ramirez Luna, Omar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1276044493-23003-3-git-send-email-omar.ramirez@ti.com \
--to=omar.ramirez@ti.com \
--cc=Hiroshi.DOYU@nokia.com \
--cc=ameya.palande@nokia.com \
--cc=felipe.contreras@nokia.com \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).