]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/cpqphp.h
Merge branch 'x86/um-header' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / cpqphp.h
index cb88404c89fe05682916430778edac3fff60cb30..afaf8f69f73ec0938f754f427822a929697b79b4 100644 (file)
 #ifndef _CPQPHP_H
 #define _CPQPHP_H
 
-#include "pci_hotplug.h"
 #include <linux/interrupt.h>
 #include <asm/io.h>            /* for read? and write? functions */
 #include <linux/delay.h>       /* for delays */
+#include <linux/mutex.h>
 
 #define MY_NAME        "cpqphp"
 
@@ -286,7 +286,7 @@ struct event_info {
 struct controller {
        struct controller *next;
        u32 ctrl_int_comp;
-       struct semaphore crit_sect;     /* critical section semaphore */
+       struct mutex crit_sect;         /* critical section mutex */
        void __iomem *hpc_reg;          /* cookie for our pci controller location */
        struct pci_resource *mem_head;
        struct pci_resource *p_mem_head;
@@ -408,7 +408,7 @@ extern void cpqhp_remove_debugfs_files              (struct controller *ctrl);
 
 /* controller functions */
 extern void    cpqhp_pushbutton_thread         (unsigned long event_pointer);
-extern irqreturn_t cpqhp_ctrl_intr             (int IRQ, void *data, struct pt_regs *regs);
+extern irqreturn_t cpqhp_ctrl_intr             (int IRQ, void *data);
 extern int     cpqhp_find_available_resources  (struct controller *ctrl, void __iomem *rom_start);
 extern int     cpqhp_event_start_thread        (void);
 extern void    cpqhp_event_stop_thread         (void);
@@ -449,6 +449,11 @@ extern u8 cpqhp_disk_irq;
 
 /* inline functions */
 
+static inline char *slot_name(struct slot *slot)
+{
+       return hotplug_slot_name(slot->hotplug_slot);
+}
+
 /*
  * return_resource
  *
@@ -674,7 +679,7 @@ static inline int cpq_get_latch_status(struct controller *ctrl, struct slot *slo
 
        hp_slot = slot->device - ctrl->slot_device_offset;
        dbg("%s: slot->device = %d, ctrl->slot_device_offset = %d \n",
-           __FUNCTION__, slot->device, ctrl->slot_device_offset);
+           __func__, slot->device, ctrl->slot_device_offset);
 
        status = (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot));
 
@@ -696,20 +701,12 @@ static inline int get_presence_status(struct controller *ctrl, struct slot *slot
        return presence_save;
 }
 
-#define SLOT_NAME_SIZE 10
-
-static inline void make_slot_name(char *buffer, int buffer_size, struct slot *slot)
-{
-       snprintf(buffer, buffer_size, "%d", slot->number);
-}
-
-
 static inline int wait_for_ctrl_irq(struct controller *ctrl)
 {
         DECLARE_WAITQUEUE(wait, current);
        int retval = 0;
 
-       dbg("%s - start\n", __FUNCTION__);
+       dbg("%s - start\n", __func__);
        add_wait_queue(&ctrl->queue, &wait);
        /* Sleep for up to 1 second to wait for the LED to change. */
        msleep_interruptible(1000);
@@ -717,7 +714,7 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl)
        if (signal_pending(current))
                retval =  -EINTR;
 
-       dbg("%s - end\n", __FUNCTION__);
+       dbg("%s - end\n", __func__);
        return retval;
 }