lkml.org 
[lkml]   [2006]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[ patch -mm1 04/11 ] gpio-patchset-fixups: request-region

diff.13-fix-request-region

Usage of request_region() was wrong ( returns 0 on error - docpatch sent
to trivial ).
This fixes it, and clarifies the err-msg.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>

---

diff -ruNp -X dontdiff -X exclude-diffs 17-mm-pre0/drivers/char/pc8736x_gpio.c 13/drivers/char/pc8736x_gpio.c
--- 17-mm-pre0/drivers/char/pc8736x_gpio.c 2006-06-20 20:42:39.000000000 -0600
+++ 13/drivers/char/pc8736x_gpio.c 2006-06-21 10:31:31.000000000 -0600
@@ -297,9 +297,12 @@ static int __init pc8736x_gpio_init(void
pc8736x_gpio_base = (superio_inb(SIO_BASE_HADDR) << 8
| superio_inb(SIO_BASE_LADDR));

- if (request_region(pc8736x_gpio_base, 16, DEVNAME))
- dev_info(&pdev->dev, "GPIO ioport %x reserved\n",
- pc8736x_gpio_base);
+ if (!request_region(pc8736x_gpio_base, 16, DEVNAME)) {
+ dev_err(&pdev->dev, "GPIO ioport %x busy\n",
+ pc8736x_gpio_base);
+ return -ENODEV;
+ }
+ dev_info(&pdev->dev, "GPIO ioport %x reserved\n", pc8736x_gpio_base);

r = register_chrdev(major, DEVNAME, &pc8736x_gpio_fops);
if (r < 0) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-22 20:53    [W:0.079 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site