diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/arch_topology.c | 2 | ||||
-rw-r--r-- | drivers/base/core.c | 2 | ||||
-rw-r--r-- | drivers/base/dd.c | 16 | ||||
-rw-r--r-- | drivers/base/test/test_async_driver_probe.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/hfi1/debugfs.c | 20 |
5 files changed, 27 insertions, 19 deletions
diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 0739c5b953bf..4de87b0b53c8 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -105,7 +105,7 @@ subsys_initcall(register_cpu_capacity_sysctl); static u32 capacity_scale; static u32 *raw_capacity; -static int __init free_raw_capacity(void) +static int free_raw_capacity(void) { kfree(raw_capacity); raw_capacity = NULL; diff --git a/drivers/base/core.c b/drivers/base/core.c index a36cf1bd07a9..110230d86527 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1958,7 +1958,6 @@ void device_del(struct device *dev) blocking_notifier_call_chain(&dev->bus->p->bus_notifier, BUS_NOTIFY_DEL_DEVICE, dev); - device_links_purge(dev); dpm_sysfs_remove(dev); if (parent) klist_del(&dev->p->knode_parent); @@ -1986,6 +1985,7 @@ void device_del(struct device *dev) device_pm_remove(dev); driver_deferred_probe_del(dev); device_remove_properties(dev); + device_links_purge(dev); /* Notify the platform of the removal, in case they * need to do anything... diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 45575e134696..2c964f56dafe 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -350,6 +350,15 @@ EXPORT_SYMBOL_GPL(device_bind_driver); static atomic_t probe_count = ATOMIC_INIT(0); static DECLARE_WAIT_QUEUE_HEAD(probe_waitqueue); +static void driver_deferred_probe_add_trigger(struct device *dev, + int local_trigger_count) +{ + driver_deferred_probe_add(dev); + /* Did a trigger occur while probing? Need to re-trigger if yes */ + if (local_trigger_count != atomic_read(&deferred_trigger_count)) + driver_deferred_probe_trigger(); +} + static int really_probe(struct device *dev, struct device_driver *drv) { int ret = -EPROBE_DEFER; @@ -369,6 +378,8 @@ static int really_probe(struct device *dev, struct device_driver *drv) } ret = device_links_check_suppliers(dev); + if (ret == -EPROBE_DEFER) + driver_deferred_probe_add_trigger(dev, local_trigger_count); if (ret) return ret; @@ -470,10 +481,7 @@ pinctrl_bind_failed: case -EPROBE_DEFER: /* Driver requested deferred probing */ dev_dbg(dev, "Driver %s requests probe deferral\n", drv->name); - driver_deferred_probe_add(dev); - /* Did a trigger occur while probing? Need to re-trigger if yes */ - if (local_trigger_count != atomic_read(&deferred_trigger_count)) - driver_deferred_probe_trigger(); + driver_deferred_probe_add_trigger(dev, local_trigger_count); break; case -ENODEV: case -ENXIO: diff --git a/drivers/base/test/test_async_driver_probe.c b/drivers/base/test/test_async_driver_probe.c index 304d5c2bd5e9..a3355d66bc12 100644 --- a/drivers/base/test/test_async_driver_probe.c +++ b/drivers/base/test/test_async_driver_probe.c @@ -64,7 +64,7 @@ static int __init test_async_probe_init(void) NULL, 0); if (IS_ERR(async_dev_1)) { error = PTR_ERR(async_dev_1); - pr_err("failed to create async_dev_1: %d", error); + pr_err("failed to create async_dev_1: %d\n", error); return error; } @@ -91,7 +91,7 @@ static int __init test_async_probe_init(void) NULL, 0); if (IS_ERR(async_dev_2)) { error = PTR_ERR(async_dev_2); - pr_err("failed to create async_dev_2: %d", error); + pr_err("failed to create async_dev_2: %d\n", error); goto err_unregister_async_driver; } @@ -118,7 +118,7 @@ static int __init test_async_probe_init(void) NULL, 0); if (IS_ERR(sync_dev_1)) { error = PTR_ERR(sync_dev_1); - pr_err("failed to create sync_dev_1: %d", error); + pr_err("failed to create sync_dev_1: %d\n", error); goto err_unregister_sync_driver; } diff --git a/drivers/infiniband/hw/hfi1/debugfs.c b/drivers/infiniband/hw/hfi1/debugfs.c index 76157cc03eca..2e6e0c516041 100644 --- a/drivers/infiniband/hw/hfi1/debugfs.c +++ b/drivers/infiniband/hw/hfi1/debugfs.c @@ -71,13 +71,13 @@ static ssize_t hfi1_seq_read( loff_t *ppos) { struct dentry *d = file->f_path.dentry; - int srcu_idx; ssize_t r; - r = debugfs_use_file_start(d, &srcu_idx); - if (likely(!r)) - r = seq_read(file, buf, size, ppos); - debugfs_use_file_finish(srcu_idx); + r = debugfs_file_get(d); + if (unlikely(r)) + return r; + r = seq_read(file, buf, size, ppos); + debugfs_file_put(d); return r; } @@ -87,13 +87,13 @@ static loff_t hfi1_seq_lseek( int whence) { struct dentry *d = file->f_path.dentry; - int srcu_idx; loff_t r; - r = debugfs_use_file_start(d, &srcu_idx); - if (likely(!r)) - r = seq_lseek(file, offset, whence); - debugfs_use_file_finish(srcu_idx); + r = debugfs_file_get(d); + if (unlikely(r)) + return r; + r = seq_lseek(file, offset, whence); + debugfs_file_put(d); return r; } |