diff options
author | Damian Hobson-Garcia <dhobsong@igel.co.jp> | 2013-03-25 21:31:22 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-29 12:08:22 -0400 |
commit | 5ed0505c713805f89473cdc0bbfb5110dfd840cb (patch) | |
tree | 05211aaf1a028936a314a3dcf3584f8cd6c98946 | |
parent | 7f4f2302a11173d0ef84bbab4b887b9b50c31dc6 (diff) |
drivers: uio: Fix UIO device registration failure
Until recently uio_get_minor() returned 0 for success and
a negative value on failure. This became non-negative for suceess and
negative for failure. Restore the original return value spec so that we can
successfully initialize UIO devices with a non-zero minor device
number.
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/uio/uio.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index c8b926291e28..b645c47501b4 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
@@ -374,6 +374,7 @@ static int uio_get_minor(struct uio_device *idev) | |||
374 | retval = idr_alloc(&uio_idr, idev, 0, UIO_MAX_DEVICES, GFP_KERNEL); | 374 | retval = idr_alloc(&uio_idr, idev, 0, UIO_MAX_DEVICES, GFP_KERNEL); |
375 | if (retval >= 0) { | 375 | if (retval >= 0) { |
376 | idev->minor = retval; | 376 | idev->minor = retval; |
377 | retval = 0; | ||
377 | } else if (retval == -ENOSPC) { | 378 | } else if (retval == -ENOSPC) { |
378 | dev_err(idev->dev, "too many uio devices\n"); | 379 | dev_err(idev->dev, "too many uio devices\n"); |
379 | retval = -EINVAL; | 380 | retval = -EINVAL; |