From: Damian Hobson-Garcia Date: Tue, 26 Mar 2013 01:31:22 +0000 (+0900) Subject: drivers: uio: Fix UIO device registration failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5ed0505c713805f89473cdc0bbfb5110dfd840cb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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" Signed-off-by: Damian Hobson-Garcia Signed-off-by: Greg Kroah-Hartman --- 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) retval = idr_alloc(&uio_idr, idev, 0, UIO_MAX_DEVICES, GFP_KERNEL); if (retval >= 0) { idev->minor = retval; + retval = 0; } else if (retval == -ENOSPC) { dev_err(idev->dev, "too many uio devices\n"); retval = -EINVAL;