Merge branch 'e1000-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[pandora-kernel.git] / drivers / parisc / led.c
index 298f2dd..453e682 100644 (file)
@@ -23,7 +23,6 @@
  *                               David Pye <dmp@davidmpye.dyndns.org>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/stddef.h>      /* for offsetof() */
 #include <linux/init.h>
@@ -67,8 +66,8 @@ static char lcd_text_default[32]  __read_mostly;
 
 
 static struct workqueue_struct *led_wq;
-static void led_work_func(void *);
-static DECLARE_WORK(led_task, led_work_func, NULL);
+static void led_work_func(struct work_struct *);
+static DECLARE_DELAYED_WORK(led_task, led_work_func);
 
 #if 0
 #define DPRINTK(x)     printk x
@@ -137,7 +136,7 @@ static int start_task(void)
 
        /* Create the work queue and queue the LED task */
        led_wq = create_singlethread_workqueue("led_wq");       
-       queue_work(led_wq, &led_task);
+       queue_delayed_work(led_wq, &led_task, 0);
 
        return 0;
 }
@@ -253,7 +252,6 @@ static int __init led_create_procfs(void)
        proc_pdc_root->owner = THIS_MODULE;
        ent = create_proc_entry("led", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root);
        if (!ent) return -1;
-       ent->nlink = 1;
        ent->data = (void *)LED_NOLCD; /* LED */
        ent->read_proc = led_proc_read;
        ent->write_proc = led_proc_write;
@@ -263,7 +261,6 @@ static int __init led_create_procfs(void)
        {
                ent = create_proc_entry("lcd", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root);
                if (!ent) return -1;
-               ent->nlink = 1;
                ent->data = (void *)LED_HASLCD; /* LCD */
                ent->read_proc = led_proc_read;
                ent->write_proc = led_proc_write;
@@ -375,9 +372,9 @@ static __inline__ int led_get_net_activity(void)
                continue;
            if (LOOPBACK(in_dev->ifa_list->ifa_local))
                continue;
-           if (!dev->get_stats) 
-               continue;
            stats = dev->get_stats(dev);
+           if (!stats)
+               continue;
            rx_total += stats->rx_packets;
            tx_total += stats->tx_packets;
        }
@@ -411,16 +408,17 @@ static __inline__ int led_get_net_activity(void)
 static __inline__ int led_get_diskio_activity(void)
 {      
        static unsigned long last_pgpgin, last_pgpgout;
-       struct page_state pgstat;
+       unsigned long events[NR_VM_EVENT_ITEMS];
        int changed;
 
-       get_full_page_state(&pgstat); /* get no of sectors in & out */
+       all_vm_events(events);
 
        /* Just use a very simple calculation here. Do not care about overflow,
           since we only want to know if there was activity or not. */
-       changed = (pgstat.pgpgin != last_pgpgin) || (pgstat.pgpgout != last_pgpgout);
-       last_pgpgin  = pgstat.pgpgin;
-       last_pgpgout = pgstat.pgpgout;
+       changed = (events[PGPGIN] != last_pgpgin) ||
+                 (events[PGPGOUT] != last_pgpgout);
+       last_pgpgin  = events[PGPGIN];
+       last_pgpgout = events[PGPGOUT];
 
        return (changed ? LED_DISK_IO : 0);
 }
@@ -443,7 +441,7 @@ static __inline__ int led_get_diskio_activity(void)
 
 #define LED_UPDATE_INTERVAL (1 + (HZ*19/1000))
 
-static void led_work_func (void *unused)
+static void led_work_func (struct work_struct *unused)
 {
        static unsigned long last_jiffies;
        static unsigned long count_HZ; /* counter in range 0..HZ */
@@ -590,7 +588,7 @@ int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long d
 
        /* Ensure the work is queued */
        if (led_wq) {
-               queue_work(led_wq, &led_task);
+               queue_delayed_work(led_wq, &led_task, 0);
        }
 
        return 0;
@@ -631,7 +629,7 @@ void __init register_led_regions(void)
    ** avoid a race condition while writing the CMD/DATA register pair.
    **
  */
-int lcd_print( char *str )
+int lcd_print( const char *str )
 {
        int i;
 
@@ -660,7 +658,7 @@ int lcd_print( char *str )
        
        /* re-queue the work */
        if (led_wq) {
-               queue_work(led_wq, &led_task);
+               queue_delayed_work(led_wq, &led_task, 0);
        }
 
        return lcd_info.lcd_width;
@@ -684,7 +682,7 @@ int __init led_init(void)
        int ret;
 
        snprintf(lcd_text_default, sizeof(lcd_text_default),
-               "Linux %s", system_utsname.release);
+               "Linux %s", init_utsname()->release);
 
        /* Work around the buggy PDC of KittyHawk-machines */
        switch (CPU_HVERSION) {