summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2010-03-30 16:54:38 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2010-03-30 16:54:38 +1100
commit366d163311928dc5b3d5b5700ce34a96f247009e (patch)
tree151b9d0348c05966d1d425d43fd5ac58cbf40d4c /include
parentd9c0ea42b763b321479c00f7ba1ca141905955bc (diff)
parent832d72674364863496fee86a1dfd7c38b0a5c333 (diff)
Merge branch 'quilt/driver-core'
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h13
-rw-r--r--include/linux/kref.h1
-rw-r--r--include/linux/ramfs.h2
3 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 182192892d45..6f9619190aaf 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -22,7 +22,6 @@
#include <linux/types.h>
#include <linux/module.h>
#include <linux/pm.h>
-#include <linux/semaphore.h>
#include <asm/atomic.h>
#include <asm/device.h>
@@ -404,7 +403,7 @@ struct device {
const char *init_name; /* initial name of the device */
struct device_type *type;
- struct semaphore sem; /* semaphore to synchronize calls to
+ struct mutex mutex; /* mutex to synchronize calls to
* its driver.
*/
@@ -451,6 +450,10 @@ struct device {
static inline const char *dev_name(const struct device *dev)
{
+ /* Use the init name until the kobject becomes available */
+ if (dev->init_name)
+ return dev->init_name;
+
return kobject_name(&dev->kobj);
}
@@ -510,17 +513,17 @@ static inline bool device_async_suspend_enabled(struct device *dev)
static inline void device_lock(struct device *dev)
{
- down(&dev->sem);
+ mutex_lock(&dev->mutex);
}
static inline int device_trylock(struct device *dev)
{
- return down_trylock(&dev->sem);
+ return mutex_trylock(&dev->mutex);
}
static inline void device_unlock(struct device *dev)
{
- up(&dev->sem);
+ mutex_unlock(&dev->mutex);
}
void driver_init(void);
diff --git a/include/linux/kref.h b/include/linux/kref.h
index baf4b9e4b194..6cc38fc07ab7 100644
--- a/include/linux/kref.h
+++ b/include/linux/kref.h
@@ -21,7 +21,6 @@ struct kref {
atomic_t refcount;
};
-void kref_set(struct kref *kref, int num);
void kref_init(struct kref *kref);
void kref_get(struct kref *kref);
int kref_put(struct kref *kref, void (*release) (struct kref *kref));
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 4e768dda87b0..8600508c77a6 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -20,4 +20,6 @@ extern const struct file_operations ramfs_file_operations;
extern const struct vm_operations_struct generic_file_vm_ops;
extern int __init init_rootfs(void);
+int ramfs_fill_super(struct super_block *sb, void *data, int silent);
+
#endif