diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2010-03-30 16:54:38 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2010-03-30 16:54:38 +1100 |
commit | 366d163311928dc5b3d5b5700ce34a96f247009e (patch) | |
tree | 151b9d0348c05966d1d425d43fd5ac58cbf40d4c /drivers | |
parent | d9c0ea42b763b321479c00f7ba1ca141905955bc (diff) | |
parent | 832d72674364863496fee86a1dfd7c38b0a5c333 (diff) |
Merge branch 'quilt/driver-core'
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/Kconfig | 7 | ||||
-rw-r--r-- | drivers/base/core.c | 4 | ||||
-rw-r--r-- | drivers/base/dd.c | 4 | ||||
-rw-r--r-- | drivers/base/devtmpfs.c | 5 | ||||
-rw-r--r-- | drivers/base/firmware_class.c | 5 | ||||
-rw-r--r-- | drivers/base/module.c | 4 | ||||
-rw-r--r-- | drivers/base/platform.c | 27 | ||||
-rw-r--r-- | drivers/net/mlx4/mlx4.h | 1 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/quatech_daqp_cs.c | 1 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 2 |
10 files changed, 42 insertions, 18 deletions
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index fd52c48ee762..ef38aff737eb 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -18,9 +18,9 @@ config UEVENT_HELPER_PATH config DEVTMPFS bool "Maintain a devtmpfs filesystem to mount at /dev" - depends on HOTPLUG && SHMEM && TMPFS + depends on HOTPLUG help - This creates a tmpfs filesystem instance early at bootup. + This creates a tmpfs/ramfs filesystem instance early at bootup. In this filesystem, the kernel driver core maintains device nodes with their default names and permissions for all registered devices with an assigned major/minor number. @@ -33,6 +33,9 @@ config DEVTMPFS functional /dev without any further help. It also allows simple rescue systems, and reliably handles dynamic major/minor numbers. + Notice: if CONFIG_TMPFS isn't enabled, the simpler ramfs + file system will be used instead. + config DEVTMPFS_MOUNT bool "Automount devtmpfs at /dev, after the kernel mounted the rootfs" depends on DEVTMPFS diff --git a/drivers/base/core.c b/drivers/base/core.c index b56a0ba31d4a..cf507a7d200c 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -20,7 +20,6 @@ #include <linux/notifier.h> #include <linux/genhd.h> #include <linux/kallsyms.h> -#include <linux/semaphore.h> #include <linux/mutex.h> #include <linux/async.h> @@ -559,10 +558,9 @@ void device_initialize(struct device *dev) dev->kobj.kset = devices_kset; kobject_init(&dev->kobj, &device_ktype); INIT_LIST_HEAD(&dev->dma_pools); - init_MUTEX(&dev->sem); + mutex_init(&dev->mutex); spin_lock_init(&dev->devres_lock); INIT_LIST_HEAD(&dev->devres_head); - device_init_wakeup(dev, 0); device_pm_init(dev); set_dev_node(dev, -1); } diff --git a/drivers/base/dd.c b/drivers/base/dd.c index c89291f8a16b..503c2620bbcc 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -40,11 +40,11 @@ static void driver_bound(struct device *dev) pr_debug("driver: '%s': %s: bound to device '%s'\n", dev_name(dev), __func__, dev->driver->name); + klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices); + if (dev->bus) blocking_notifier_call_chain(&dev->bus->p->bus_notifier, BUS_NOTIFY_BOUND_DRIVER, dev); - - klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices); } static int driver_sysfs_add(struct device *dev) diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index dac478c6e460..6927262c7710 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c @@ -20,6 +20,7 @@ #include <linux/namei.h> #include <linux/fs.h> #include <linux/shmem_fs.h> +#include <linux/ramfs.h> #include <linux/cred.h> #include <linux/sched.h> #include <linux/init_task.h> @@ -44,7 +45,11 @@ __setup("devtmpfs.mount=", mount_param); static int dev_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt) { +#ifdef CONFIG_TMPFS return get_sb_single(fs_type, flags, data, shmem_fill_super, mnt); +#else + return get_sb_single(fs_type, flags, data, ramfs_fill_super, mnt); +#endif } static struct file_system_type dev_fs_type = { diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 18518ba13c81..a897000655eb 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -492,15 +492,14 @@ _request_firmware(const struct firmware **firmware_p, const char *name, builtin++) { if (strcmp(name, builtin->name)) continue; - dev_info(device, "firmware: using built-in firmware %s\n", - name); + dev_dbg(device, "firmware: using built-in firmware %s\n", name); firmware->size = builtin->size; firmware->data = builtin->data; return 0; } if (uevent) - dev_info(device, "firmware: requesting %s\n", name); + dev_dbg(device, "firmware: requesting %s\n", name); retval = fw_setup_device(firmware, &f_dev, name, device, uevent); if (retval) diff --git a/drivers/base/module.c b/drivers/base/module.c index 103be9cacb05..51c1fb6b947f 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c @@ -14,12 +14,10 @@ static char *make_driver_name(struct device_driver *drv) { char *driver_name; - driver_name = kmalloc(strlen(drv->name) + strlen(drv->bus->name) + 2, - GFP_KERNEL); + driver_name = kasprintf(GFP_KERNEL, "%s:%s", drv->bus->name, drv->name); if (!driver_name) return NULL; - sprintf(driver_name, "%s:%s", drv->bus->name, drv->name); return driver_name; } diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 4b4b565c835f..43479a9a9c3b 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -735,7 +735,7 @@ static void platform_pm_complete(struct device *dev) #ifdef CONFIG_SUSPEND -static int platform_pm_suspend(struct device *dev) +int __weak platform_pm_suspend(struct device *dev) { struct device_driver *drv = dev->driver; int ret = 0; @@ -753,7 +753,7 @@ static int platform_pm_suspend(struct device *dev) return ret; } -static int platform_pm_suspend_noirq(struct device *dev) +int __weak platform_pm_suspend_noirq(struct device *dev) { struct device_driver *drv = dev->driver; int ret = 0; @@ -769,7 +769,7 @@ static int platform_pm_suspend_noirq(struct device *dev) return ret; } -static int platform_pm_resume(struct device *dev) +int __weak platform_pm_resume(struct device *dev) { struct device_driver *drv = dev->driver; int ret = 0; @@ -787,7 +787,7 @@ static int platform_pm_resume(struct device *dev) return ret; } -static int platform_pm_resume_noirq(struct device *dev) +int __weak platform_pm_resume_noirq(struct device *dev) { struct device_driver *drv = dev->driver; int ret = 0; @@ -1254,6 +1254,25 @@ static int __init early_platform_driver_probe_id(char *class_str, } if (match) { + /* + * Set up a sensible init_name to enable + * dev_name() and others to be used before the + * rest of the driver core is initialized. + */ + if (!match->dev.init_name) { + char buf[32]; + + if (match->id != -1) + snprintf(buf, sizeof(buf), "%s.%d", + match->name, match->id); + else + snprintf(buf, sizeof(buf), "%s", + match->name); + + match->dev.init_name = kstrdup(buf, GFP_KERNEL); + if (!match->dev.init_name) + return -ENOMEM; + } if (epdrv->pdrv->probe(match)) pr_warning("%s: unable to probe %s early.\n", class_str, match->name); diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index bc72d6e4919b..13343e884999 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -40,6 +40,7 @@ #include <linux/mutex.h> #include <linux/radix-tree.h> #include <linux/timer.h> +#include <linux/semaphore.h> #include <linux/workqueue.h> #include <linux/mlx4/device.h> diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c index 7aa17f92968c..92d7b72362b2 100644 --- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c +++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c @@ -48,6 +48,7 @@ Devices: [Quatech] DAQP-208 (daqp), DAQP-308 */ #include "../comedidev.h" +#include <linux/semaphore.h> #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 1297e9b16a51..0c6581003339 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -573,7 +573,7 @@ int usb_lock_device_for_reset(struct usb_device *udev, iface->condition == USB_INTERFACE_UNBOUND)) return -EINTR; - while (usb_trylock_device(udev) != 0) { + while (!usb_trylock_device(udev)) { /* If we can't acquire the lock after waiting one second, * we're probably deadlocked */ |