public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	Marek Vasut <marek.vasut@gmail.com>
Subject: [PATCH] ucb1400_core: avoid calling platform_device_put() twice in ucb1400_core_probe error path
Date: Tue, 03 Aug 2010 16:34:13 +0800	[thread overview]
Message-ID: <1280824453.19576.1.camel@mola> (raw)

In the case of goto err2, what we want is to call
platform_device_del() instead of platform_device_unregister().
Otherwise, we call platform_device_put() twice.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/mfd/ucb1400_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c
index dbe2801..d73f84b 100644
--- a/drivers/mfd/ucb1400_core.c
+++ b/drivers/mfd/ucb1400_core.c
@@ -114,7 +114,7 @@ static int ucb1400_core_probe(struct device *dev)
 err3:
 	platform_device_put(ucb->ucb1400_ts);
 err2:
-	platform_device_unregister(ucb->ucb1400_gpio);
+	platform_device_del(ucb->ucb1400_gpio);
 err1:
 	platform_device_put(ucb->ucb1400_gpio);
 err0:
-- 
1.5.4.3




             reply	other threads:[~2010-08-03  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03  8:34 Axel Lin [this message]
2010-08-03 10:34 ` [PATCH] ucb1400_core: avoid calling platform_device_put() twice in ucb1400_core_probe error path Samuel Ortiz
2010-08-03 11:23   ` Marek Vasut

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=1280824453.19576.1.camel@mola \
    --to=axel.lin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=sameo@linux.intel.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