]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Trivial patch for msbusmouse.c
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 22 Apr 2002 06:11:47 +0000 (23:11 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 22 Apr 2002 06:11:47 +0000 (23:11 -0700)
johnpol@2ka.mipt.ru: Re: Trivial patch for msbusmouse.c:
  > On Tue, Mar 19, 2002 at 03:22:58PM +1100, Rusty Russell wrote:
  > > Hi Russell,
  > >
  > >  Please check this request_region() cleanup patch from Evgeniy
  > > Polyakov against 2.4 and 2.5.
  >
  > Both patches look fine, apart from the disgusting formatting being
  > different from the rest of the files.

  As you wish...

  > --
  > Russell King (rmk@arm.linux.org.uk)                The developer of
  > ARM Linux
  > http://www.arm.linux.org.uk/personal/aboutme.html

   Evgeniy Polyakov ( s0mbre )

drivers/char/msbusmouse.c

index 81d35b0c41bee5621c5f3e1d26e8e81f785f47b3..4854d1d9d559884f59ddd40ca359408a43173862 100644 (file)
@@ -149,11 +149,15 @@ static int __init ms_bus_mouse_init(void)
        }
        if (present == 0)
                return -EIO;
+       if (!request_region(MS_MSE_CONTROL_PORT, 0x04, "MS Busmouse"))
+               return -EIO;
+       
        MS_MSE_INT_OFF();
-       request_region(MS_MSE_CONTROL_PORT, 0x04, "MS Busmouse");
        msedev = register_busmouse(&msbusmouse);
-       if (msedev < 0)
+       if (msedev < 0) {
                printk(KERN_WARNING "Unable to register msbusmouse driver.\n");
+               release_region(MS_MSE_CONTROL_PORT, 0x04);
+       }
        else
                printk(KERN_INFO "Microsoft BusMouse detected and installed.\n");
        return msedev < 0 ? msedev : 0;