public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Stas Sergeev <stsp@aknet.ru>, stable <stable@kernel.org>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 1/9] Driver core: fix driver_register() return value
Date: Fri, 30 Oct 2009 15:54:20 -0700	[thread overview]
Message-ID: <1256943268-12164-1-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20091030220930.GA11297@kroah.com>

From: Stas Sergeev <stsp@aknet.ru>

In this patch:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=16dc42e018c2868211b4928f20a957c0c216126c
the check was added for another driver to already claim the same device
on the same bus. But the returned error code was wrong: to modprobe, the
-EEXIST means that _this_ driver is already installed. It therefore
doesn't produce the needed error message when _another_ driver is trying
to register for the same device.  Returning -EBUSY fixes the problem.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/driver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index ed2ebd3..f367885 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -236,7 +236,7 @@ int driver_register(struct device_driver *drv)
 		put_driver(other);
 		printk(KERN_ERR "Error: Driver '%s' is already registered, "
 			"aborting...\n", drv->name);
-		return -EEXIST;
+		return -EBUSY;
 	}
 
 	ret = bus_add_driver(drv);
-- 
1.6.4.2


  reply	other threads:[~2009-10-30 22:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-30 22:09 [GIT PATCH] driver core fixes for 2.6.32-git Greg KH
2009-10-30 22:54 ` Greg Kroah-Hartman [this message]
2009-10-30 22:54 ` [PATCH 2/9] Driver core: allow certain drivers prohibit bind/unbind via sysfs Greg Kroah-Hartman
2009-10-30 22:54 ` [PATCH 3/9] Documentation: ABI: rename sysfs-devices-cache_disable properly Greg Kroah-Hartman
2009-10-30 22:54 ` [PATCH 4/9] Documentation: ABI: document /sys/devices/system/cpu/ Greg Kroah-Hartman
2009-10-30 22:54 ` [PATCH 5/9] Documentation: ABI: /sys/devices/system/cpu/ topology files Greg Kroah-Hartman
2009-10-30 22:54 ` [PATCH 6/9] Documentation: ABI: /sys/devices/system/cpu/cpu#/ " Greg Kroah-Hartman
2009-10-30 22:54 ` [PATCH 7/9] Documentation: ABI: /sys/devices/system/cpu/sched_[mc|smt]_power_savings Greg Kroah-Hartman
2009-10-30 22:54 ` [PATCH 8/9] Documentation: ABI: /sys/devices/system/cpu/cpuidle/ Greg Kroah-Hartman
2009-10-30 22:54 ` [PATCH 9/9] Documentation: ABI: /sys/devices/system/cpu/cpu#/node Greg Kroah-Hartman

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=1256943268-12164-1-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=stsp@aknet.ru \
    /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