#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/spinlock.h>
-#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
void (*stop)(struct serio *);
struct serio *parent, *child;
- unsigned int depth; /* level of nesting in serio hierarchy */
struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
- struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
+ struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */
struct device dev;
unsigned int registered; /* port has been fully registered with driver core */
}
/*
- * Use the following functions to manipulate serio's per-port
+ * Use the following fucntions to manipulate serio's per-port
* driver-specific data.
*/
static inline void *serio_get_drvdata(struct serio *serio)
}
/*
- * Use the following functions to protect critical sections in
+ * Use the following fucntions to protect critical sections in
* driver code from port's interrupt handler
*/
static inline void serio_pause_rx(struct serio *serio)
}
/*
- * Use the following functions to pin serio's driver in process context
+ * Use the following fucntions to pin serio's driver in process context
*/
static inline int serio_pin_driver(struct serio *serio)
{
- return mutex_lock_interruptible(&serio->drv_mutex);
+ return down_interruptible(&serio->drv_sem);
}
static inline void serio_pin_driver_uninterruptible(struct serio *serio)
{
- mutex_lock(&serio->drv_mutex);
+ down(&serio->drv_sem);
}
static inline void serio_unpin_driver(struct serio *serio)
{
- mutex_unlock(&serio->drv_mutex);
+ up(&serio->drv_sem);
}