V4L/DVB (6976): drivers/media/radio/radio-sf16fmr2.c: fix error handling
authorAndrew Morton <akpm@linux-foundation.org>
Mon, 7 Jan 2008 08:24:51 +0000 (05:24 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:04:41 +0000 (19:04 -0200)
video_register_device() returns -EFOO on errr, not -1.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=9699

Reported-By: <devzero@web.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/radio/radio-sf16fmr2.c

index c432c44bd634bf2144395dc0bfe902ba886b205f..f7c8b000404fffbe587b0d9ca2e96ed0c4aeadc8 100644 (file)
@@ -476,8 +476,7 @@ static int __init fmr2_init(void)
                return -EBUSY;
        }
 
-       if(video_register_device(&fmr2_radio, VFL_TYPE_RADIO, radio_nr)==-1)
-       {
+       if (video_register_device(&fmr2_radio, VFL_TYPE_RADIO, radio_nr) < 0) {
                release_region(io, 2);
                return -EINVAL;
        }