]> err.no Git - linux-2.6/blobdiff - drivers/sbus/char/envctrl.c
header cleaning: don't include smp_lock.h when not used
[linux-2.6] / drivers / sbus / char / envctrl.c
index 063e676a3ac046e5de17809cce433ca281b21dd5..f2be2ead87426d7ca70443aeeb70d21b5eedb55d 100644 (file)
  *              Daniele Bellucci <bellucda@tiscali.it>
  */
 
-#define __KERNEL_SYSCALLS__
-static int errno;
-
 #include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/init.h>
 #include <linux/kthread.h>
-#include <linux/errno.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
-#include <linux/init.h>
 #include <linux/miscdevice.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-#include <linux/kernel.h>
+#include <linux/kmod.h>
 
 #include <asm/ebus.h>
 #include <asm/uaccess.h>
@@ -712,7 +705,7 @@ envctrl_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations envctrl_fops = {
+static const struct file_operations envctrl_fops = {
        .owner =                THIS_MODULE,
        .read =                 envctrl_read,
        .unlocked_ioctl =       envctrl_ioctl,
@@ -733,7 +726,7 @@ static struct miscdevice envctrl_dev = {
  * Return: None.
  */
 static void envctrl_set_mon(struct i2c_child_t *pchild,
-                           char *chnl_desc,
+                           const char *chnl_desc,
                            int chnl_no)
 {
        /* Firmware only has temperature type.  It does not distinguish
@@ -770,8 +763,8 @@ static void envctrl_set_mon(struct i2c_child_t *pchild,
 static void envctrl_init_adc(struct i2c_child_t *pchild, struct device_node *dp)
 {
        int i = 0, len;
-       char *pos;
-       unsigned int *pval;
+       const char *pos;
+       const unsigned int *pval;
 
        /* Firmware describe channels into a stream separated by a '\0'. */
        pos = of_get_property(dp, "channels-description", &len);
@@ -866,7 +859,7 @@ static void envctrl_init_i2c_child(struct linux_ebus_child *edev_child,
 {
        int len, i, tbls_size = 0;
        struct device_node *dp = edev_child->prom_node;
-       void *pval;
+       const void *pval;
 
        /* Get device address. */
        pval = of_get_property(dp, "reg", &len);
@@ -976,13 +969,15 @@ static void envctrl_do_shutdown(void)
                "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
        char *argv[] = { 
                "/sbin/shutdown", "-h", "now", NULL };  
+       int ret;
 
        if (inprog != 0)
                return;
 
        inprog = 1;
        printk(KERN_CRIT "kenvctrld: WARNING: Shutting down the system now.\n");
-       if (0 > execve("/sbin/shutdown", argv, envp)) {
+       ret = call_usermodehelper("/sbin/shutdown", argv, envp, 0);
+       if (ret < 0) {
                printk(KERN_CRIT "kenvctrld: WARNING: system shutdown failed!\n"); 
                inprog = 0;  /* unlikely to succeed, but we could try again */
        }