aboutsummaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/Makefile2
-rw-r--r--drivers/char/drm/Kconfig4
-rw-r--r--drivers/char/drm/drm_vm.c1
-rw-r--r--drivers/char/ip2/Makefile8
-rw-r--r--drivers/char/ip2/ip2base.c (renamed from drivers/char/ip2.c)6
-rw-r--r--drivers/char/ip2/ip2main.c (renamed from drivers/char/ip2main.c)20
-rw-r--r--drivers/char/s3c2410-rtc.c4
-rw-r--r--drivers/char/snsc.h5
-rw-r--r--drivers/char/snsc_event.c32
-rw-r--r--drivers/char/tb0219.c24
-rw-r--r--drivers/char/vr41xx_giu.c19
-rw-r--r--drivers/char/vr41xx_rtc.c30
-rw-r--r--drivers/char/watchdog/mpcore_wdt.c4
-rw-r--r--drivers/char/watchdog/mv64x60_wdt.c20
14 files changed, 122 insertions, 57 deletions
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 503dd901d40..090d154098b 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -31,7 +31,7 @@ obj-$(CONFIG_MOXA_INTELLIO) += moxa.o
obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o
obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
-obj-$(CONFIG_COMPUTONE) += ip2.o ip2main.o
+obj-$(CONFIG_COMPUTONE) += ip2/
obj-$(CONFIG_RISCOM8) += riscom8.o
obj-$(CONFIG_ISI) += isicom.o
obj-$(CONFIG_SYNCLINK) += synclink.o
diff --git a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig
index 56ace9d5e2a..5278c388d3e 100644
--- a/drivers/char/drm/Kconfig
+++ b/drivers/char/drm/Kconfig
@@ -37,8 +37,8 @@ config DRM_RADEON
help
Choose this option if you have an ATI Radeon graphics card. There
are both PCI and AGP versions. You don't need to choose this to
- run the Radeon in plain VGA mode. There is a product page at
- <http://www.ati.com/na/pages/products/pc/radeon32/index.html>.
+ run the Radeon in plain VGA mode.
+
If M is selected, the module will be called radeon.
config DRM_I810
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index 0291cd62c69..ffd0800ed60 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -619,6 +619,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
#endif
offset = dev->driver->get_reg_ofs(dev);
#ifdef __sparc__
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
if (io_remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start,
(map->offset + offset) >> PAGE_SHIFT,
vma->vm_end - vma->vm_start,
diff --git a/drivers/char/ip2/Makefile b/drivers/char/ip2/Makefile
new file mode 100644
index 00000000000..6bfe2543ddc
--- /dev/null
+++ b/drivers/char/ip2/Makefile
@@ -0,0 +1,8 @@
+#
+# Makefile for the Computone IntelliPort Plus Driver
+#
+
+obj-$(CONFIG_COMPUTONE) += ip2.o ip2main.o
+
+ip2-objs := ip2base.o
+
diff --git a/drivers/char/ip2.c b/drivers/char/ip2/ip2base.c
index 7cadfc6ef35..435ccfc7495 100644
--- a/drivers/char/ip2.c
+++ b/drivers/char/ip2/ip2base.c
@@ -20,14 +20,14 @@
#define __initdata
#endif
-#include "./ip2/ip2types.h"
-#include "./ip2/fip_firm.h" // the meat
+#include "ip2types.h"
+#include "fip_firm.h" // the meat
int
ip2_loadmain(int *, int *, unsigned char *, int ); // ref into ip2main.c
/* Note: Add compiled in defaults to these arrays, not to the structure
- in ip2/ip2.h any longer. That structure WILL get overridden
+ in ip2.h any longer. That structure WILL get overridden
by these values, or command line values, or insmod values!!! =mhw=
*/
static int io[IP2_MAX_BOARDS]= { 0, 0, 0, 0 };
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2/ip2main.c
index 48fcfba37bf..03db1cb3fa9 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -35,7 +35,7 @@
// Clean up potential NULL pointer dereferences
// Clean up devfs registration
// Add kernel command line parsing for io and irq
-// Compile defaults for io and irq are now set in ip2.c not ip2/ip2.h!
+// Compile defaults for io and irq are now set in ip2.c not ip2.h!
// Reworked poll_only hack for explicit parameter setting
// You must now EXPLICITLY set poll_only = 1 or set all irqs to 0
// Merged ip2_loadmain and old_ip2_init
@@ -123,12 +123,12 @@
#include <asm/uaccess.h>
-#include "./ip2/ip2types.h"
-#include "./ip2/ip2trace.h"
-#include "./ip2/ip2ioctl.h"
-#include "./ip2/ip2.h"
-#include "./ip2/i2ellis.h"
-#include "./ip2/i2lib.h"
+#include "ip2types.h"
+#include "ip2trace.h"
+#include "ip2ioctl.h"
+#include "ip2.h"
+#include "i2ellis.h"
+#include "i2lib.h"
/*****************
* /proc/ip2mem *
@@ -282,9 +282,9 @@ static int tracewrap;
/* Code */
/********/
-#include "./ip2/i2ellis.c" /* Extremely low-level interface services */
-#include "./ip2/i2cmd.c" /* Standard loadware command definitions */
-#include "./ip2/i2lib.c" /* High level interface services */
+#include "i2ellis.c" /* Extremely low-level interface services */
+#include "i2cmd.c" /* Standard loadware command definitions */
+#include "i2lib.c" /* High level interface services */
/* Configuration area for modprobe */
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c
index 2e308657f6f..b0038b19b50 100644
--- a/drivers/char/s3c2410-rtc.c
+++ b/drivers/char/s3c2410-rtc.c
@@ -448,13 +448,13 @@ static int s3c2410_rtc_probe(struct platform_device *pdev)
/* find the IRQs */
s3c2410_rtc_tickno = platform_get_irq(pdev, 1);
- if (s3c2410_rtc_tickno <= 0) {
+ if (s3c2410_rtc_tickno < 0) {
dev_err(&pdev->dev, "no irq for rtc tick\n");
return -ENOENT;
}
s3c2410_rtc_alarmno = platform_get_irq(pdev, 0);
- if (s3c2410_rtc_alarmno <= 0) {
+ if (s3c2410_rtc_alarmno < 0) {
dev_err(&pdev->dev, "no irq for alarm\n");
return -ENOENT;
}
diff --git a/drivers/char/snsc.h b/drivers/char/snsc.h
index a9efc13cc85..8a98169b60c 100644
--- a/drivers/char/snsc.h
+++ b/drivers/char/snsc.h
@@ -5,7 +5,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2004-2006 Silicon Graphics, Inc. All rights reserved.
*/
/*
@@ -70,6 +70,9 @@ struct sysctl_data_s {
#define EV_CLASS_TEST_WARNING 0x6000ul
#define EV_CLASS_PWRD_NOTIFY 0x8000ul
+/* ENV class codes */
+#define ENV_PWRDN_PEND 0x4101ul
+
#define EV_SEVERITY_POWER_STABLE 0x0000ul
#define EV_SEVERITY_POWER_LOW_WARNING 0x0100ul
#define EV_SEVERITY_POWER_HIGH_WARNING 0x0200ul
diff --git a/drivers/char/snsc_event.c b/drivers/char/snsc_event.c
index baaa365285f..a4fa507eed9 100644
--- a/drivers/char/snsc_event.c
+++ b/drivers/char/snsc_event.c
@@ -5,7 +5,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2004-2006 Silicon Graphics, Inc. All rights reserved.
*/
/*
@@ -187,7 +187,8 @@ scdrv_event_severity(int code)
static void
scdrv_dispatch_event(char *event, int len)
{
- int code, esp_code, src;
+ static int snsc_shutting_down = 0;
+ int code, esp_code, src, class;
char desc[CHUNKSIZE];
char *severity;
@@ -199,9 +200,25 @@ scdrv_dispatch_event(char *event, int len)
/* how urgent is the message? */
severity = scdrv_event_severity(code);
- if ((code & EV_CLASS_MASK) == EV_CLASS_PWRD_NOTIFY) {
+ class = (code & EV_CLASS_MASK);
+
+ if (class == EV_CLASS_PWRD_NOTIFY || code == ENV_PWRDN_PEND) {
struct task_struct *p;
+ if (snsc_shutting_down)
+ return;
+
+ snsc_shutting_down = 1;
+
+ /* give a message for each type of event */
+ if (class == EV_CLASS_PWRD_NOTIFY)
+ printk(KERN_NOTICE "Power off indication received."
+ " Sending SIGPWR to init...\n");
+ else if (code == ENV_PWRDN_PEND)
+ printk(KERN_CRIT "WARNING: Shutting down the system"
+ " due to a critical environmental condition."
+ " Sending SIGPWR to init...\n");
+
/* give a SIGPWR signal to init proc */
/* first find init's task */
@@ -210,12 +227,11 @@ scdrv_dispatch_event(char *event, int len)
if (p->pid == 1)
break;
}
- if (p) { /* we found init's task */
- printk(KERN_EMERG "Power off indication received. Initiating power fail sequence...\n");
+ if (p) {
force_sig(SIGPWR, p);
- } else { /* failed to find init's task - just give message(s) */
- printk(KERN_WARNING "Failed to find init proc to handle power off!\n");
- printk("%s|$(0x%x)%s\n", severity, esp_code, desc);
+ } else {
+ printk(KERN_ERR "Failed to signal init!\n");
+ snsc_shutting_down = 0; /* so can try again (?) */
}
read_unlock(&tasklist_lock);
} else {
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c
index ac2a297ce37..a80c8321087 100644
--- a/drivers/char/tb0219.c
+++ b/drivers/char/tb0219.c
@@ -283,7 +283,7 @@ static void tb0219_pci_irq_init(void)
vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW);
}
-static int tb0219_probe(struct platform_device *dev)
+static int __devinit tb0219_probe(struct platform_device *dev)
{
int retval;
@@ -319,7 +319,7 @@ static int tb0219_probe(struct platform_device *dev)
return 0;
}
-static int tb0219_remove(struct platform_device *dev)
+static int __devexit tb0219_remove(struct platform_device *dev)
{
_machine_restart = old_machine_restart;
@@ -335,19 +335,26 @@ static struct platform_device *tb0219_platform_device;
static struct platform_driver tb0219_device_driver = {
.probe = tb0219_probe,
- .remove = tb0219_remove,
+ .remove = __devexit_p(tb0219_remove),
.driver = {
.name = "TB0219",
+ .owner = THIS_MODULE,
},
};
-static int __devinit tanbac_tb0219_init(void)
+static int __init tanbac_tb0219_init(void)
{
int retval;
- tb0219_platform_device = platform_device_register_simple("TB0219", -1, NULL, 0);
- if (IS_ERR(tb0219_platform_device))
- return PTR_ERR(tb0219_platform_device);
+ tb0219_platform_device = platform_device_alloc("TB0219", -1);
+ if (!tb0219_platform_device)
+ return -ENOMEM;
+
+ retval = platform_device_add(tb0219_platform_device);
+ if (retval < 0) {
+ platform_device_put(tb0219_platform_device);
+ return retval;
+ }
retval = platform_driver_register(&tb0219_device_driver);
if (retval < 0)
@@ -356,10 +363,9 @@ static int __devinit tanbac_tb0219_init(void)
return retval;
}
-static void __devexit tanbac_tb0219_exit(void)
+static void __exit tanbac_tb0219_exit(void)
{
platform_driver_unregister(&tb0219_device_driver);
-
platform_device_unregister(tb0219_platform_device);
}
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c
index 2267c7b8179..05e6e814d86 100644
--- a/drivers/char/vr41xx_giu.c
+++ b/drivers/char/vr41xx_giu.c
@@ -613,7 +613,7 @@ static struct file_operations gpio_fops = {
.release = gpio_release,
};
-static int giu_probe(struct platform_device *dev)
+static int __devinit giu_probe(struct platform_device *dev)
{
unsigned long start, size, flags = 0;
unsigned int nr_pins = 0;
@@ -697,7 +697,7 @@ static int giu_probe(struct platform_device *dev)
return cascade_irq(GIUINT_IRQ, giu_get_irq);
}
-static int giu_remove(struct platform_device *dev)
+static int __devexit giu_remove(struct platform_device *dev)
{
iounmap(giu_base);
@@ -712,9 +712,10 @@ static struct platform_device *giu_platform_device;
static struct platform_driver giu_device_driver = {
.probe = giu_probe,
- .remove = giu_remove,
+ .remove = __devexit_p(giu_remove),
.driver = {
.name = "GIU",
+ .owner = THIS_MODULE,
},
};
@@ -722,9 +723,15 @@ static int __init vr41xx_giu_init(void)
{
int retval;
- giu_platform_device = platform_device_register_simple("GIU", -1, NULL, 0);
- if (IS_ERR(giu_platform_device))
- return PTR_ERR(giu_platform_device);
+ giu_platform_device = platform_device_alloc("GIU", -1);
+ if (!giu_platform_device)
+ return -ENOMEM;
+
+ retval = platform_device_add(giu_platform_device);
+ if (retval < 0) {
+ platform_device_put(giu_platform_device);
+ return retval;
+ }
retval = platform_driver_register(&giu_device_driver);
if (retval < 0)
diff --git a/drivers/char/vr41xx_rtc.c b/drivers/char/vr41xx_rtc.c
index bc1b4a15212..b109d9a502d 100644
--- a/drivers/char/vr41xx_rtc.c
+++ b/drivers/char/vr41xx_rtc.c
@@ -558,7 +558,7 @@ static struct miscdevice rtc_miscdevice = {
.fops = &rtc_fops,
};
-static int rtc_probe(struct platform_device *pdev)
+static int __devinit rtc_probe(struct platform_device *pdev)
{
unsigned int irq;
int retval;
@@ -631,7 +631,7 @@ static int rtc_probe(struct platform_device *pdev)
return 0;
}
-static int rtc_remove(struct platform_device *dev)
+static int __devexit rtc_remove(struct platform_device *dev)
{
int retval;
@@ -653,13 +653,14 @@ static struct platform_device *rtc_platform_device;
static struct platform_driver rtc_device_driver = {
.probe = rtc_probe,
- .remove = rtc_remove,
+ .remove = __devexit_p(rtc_remove),
.driver = {
.name = rtc_name,
+ .owner = THIS_MODULE,
},
};
-static int __devinit vr41xx_rtc_init(void)
+static int __init vr41xx_rtc_init(void)
{
int retval;
@@ -684,10 +685,20 @@ static int __devinit vr41xx_rtc_init(void)
break;
}
- rtc_platform_device = platform_device_register_simple("RTC", -1,
- rtc_resource, ARRAY_SIZE(rtc_resource));
- if (IS_ERR(rtc_platform_device))
- return PTR_ERR(rtc_platform_device);
+ rtc_platform_device = platform_device_alloc("RTC", -1);
+ if (!rtc_platform_device)
+ return -ENOMEM;
+
+ retval = platform_device_add_resources(rtc_platform_device,
+ rtc_resource, ARRAY_SIZE(rtc_resource));
+
+ if (retval == 0)
+ retval = platform_device_add(rtc_platform_device);
+
+ if (retval < 0) {
+ platform_device_put(rtc_platform_device);
+ return retval;
+ }
retval = platform_driver_register(&rtc_device_driver);
if (retval < 0)
@@ -696,10 +707,9 @@ static int __devinit vr41xx_rtc_init(void)
return retval;
}
-static void __devexit vr41xx_rtc_exit(void)
+static void __exit vr41xx_rtc_exit(void)
{
platform_driver_unregister(&rtc_device_driver);
-
platform_device_unregister(rtc_platform_device);
}
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c
index b4d84348988..2c2c5177320 100644
--- a/drivers/char/watchdog/mpcore_wdt.c
+++ b/drivers/char/watchdog/mpcore_wdt.c
@@ -338,6 +338,10 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
wdt->dev = &dev->dev;
wdt->irq = platform_get_irq(dev, 0);
+ if (wdt->irq < 0) {
+ ret = -ENXIO;
+ goto err_free;
+ }
wdt->base = ioremap(res->start, res->end - res->start + 1);
if (!wdt->base) {
ret = -ENOMEM;
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c
index 00d9ef04a36..f1b9cf89f15 100644
--- a/drivers/char/watchdog/mv64x60_wdt.c
+++ b/drivers/char/watchdog/mv64x60_wdt.c
@@ -228,15 +228,25 @@ static int __init mv64x60_wdt_init(void)
printk(KERN_INFO "MV64x60 watchdog driver\n");
- mv64x60_wdt_dev = platform_device_register_simple(MV64x60_WDT_NAME,
- -1, NULL, 0);
- if (IS_ERR(mv64x60_wdt_dev)) {
- ret = PTR_ERR(mv64x60_wdt_dev);
+ mv64x60_wdt_dev = platform_device_alloc(MV64x60_WDT_NAME, -1);
+ if (!mv64x60_wdt_dev) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = platform_device_add(mv64x60_wdt_dev);
+ if (ret) {
+ platform_device_put(mv64x60_wdt_dev);
goto out;
}
ret = platform_driver_register(&mv64x60_wdt_driver);
- out:
+ if (ret) {
+ platform_device_unregister(mv64x60_wdt_dev);
+ goto out;
+ }
+
+ out:
return ret;
}