aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-01 19:28:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-01 19:28:19 -0400
commit158e0d3621683ee0cdfeeba56f0e5ddd97ae984f (patch)
treecc59e84001f0a496a681242a875ecad6463aa50e /drivers/s390
parent675c354a95d5375153b8bb80a0448cab916c7991 (diff)
parent72099304eeb316c4b00df3ae83efe4375729bd78 (diff)
Merge tag 'driver-core-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core and sysfs updates from Greg KH: "Here's the big driver core / sysfs update for 3.15-rc1. Lots of kernfs updates to make it useful for other subsystems, and a few other tiny driver core patches. All have been in linux-next for a while" * tag 'driver-core-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (42 commits) Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()" kernfs: cache atomic_write_len in kernfs_open_file numa: fix NULL pointer access and memory leak in unregister_one_node() Revert "driver core: synchronize device shutdown" kernfs: fix off by one error. kernfs: remove duplicate dir.c at the top dir x86: align x86 arch with generic CPU modalias handling cpu: add generic support for CPU feature based module autoloading sysfs: create bin_attributes under the requested group driver core: unexport static function create_syslog_header firmware: use power efficient workqueue for unloading and aborting fw load firmware: give a protection when map page failed firmware: google memconsole driver fixes firmware: fix google/gsmi duplicate efivars_sysfs_init() drivers/base: delete non-required instances of include <linux/init.h> kernfs: fix kernfs_node_from_dentry() ACPI / platform: drop redundant ACPI_HANDLE check kernfs: fix hash calculation in kernfs_rename_ns() kernfs: add CONFIG_KERNFS sysfs, kobject: add sysfs wrapper for kernfs_enable_ns() ...
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dcssblk.c14
-rw-r--r--drivers/s390/cio/ccwgroup.c26
2 files changed, 23 insertions, 17 deletions
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index ebf41e228e55..ee0e85abe1fd 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -304,12 +304,6 @@ dcssblk_load_segment(char *name, struct segment_info **seg_info)
304 return rc; 304 return rc;
305} 305}
306 306
307static void dcssblk_unregister_callback(struct device *dev)
308{
309 device_unregister(dev);
310 put_device(dev);
311}
312
313/* 307/*
314 * device attribute for switching shared/nonshared (exclusive) 308 * device attribute for switching shared/nonshared (exclusive)
315 * operation (show + store) 309 * operation (show + store)
@@ -397,7 +391,13 @@ removeseg:
397 blk_cleanup_queue(dev_info->dcssblk_queue); 391 blk_cleanup_queue(dev_info->dcssblk_queue);
398 dev_info->gd->queue = NULL; 392 dev_info->gd->queue = NULL;
399 put_disk(dev_info->gd); 393 put_disk(dev_info->gd);
400 rc = device_schedule_callback(dev, dcssblk_unregister_callback); 394 up_write(&dcssblk_devices_sem);
395
396 if (device_remove_file_self(dev, attr)) {
397 device_unregister(dev);
398 put_device(dev);
399 }
400 return rc;
401out: 401out:
402 up_write(&dcssblk_devices_sem); 402 up_write(&dcssblk_devices_sem);
403 return rc; 403 return rc;
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index fd3367a1dc7a..dfd7bc681c25 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -168,14 +168,12 @@ static ssize_t ccwgroup_online_show(struct device *dev,
168 * Provide an 'ungroup' attribute so the user can remove group devices no 168 * Provide an 'ungroup' attribute so the user can remove group devices no
169 * longer needed or accidentially created. Saves memory :) 169 * longer needed or accidentially created. Saves memory :)
170 */ 170 */
171static void ccwgroup_ungroup_callback(struct device *dev) 171static void ccwgroup_ungroup(struct ccwgroup_device *gdev)
172{ 172{
173 struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
174
175 mutex_lock(&gdev->reg_mutex); 173 mutex_lock(&gdev->reg_mutex);
176 if (device_is_registered(&gdev->dev)) { 174 if (device_is_registered(&gdev->dev)) {
177 __ccwgroup_remove_symlinks(gdev); 175 __ccwgroup_remove_symlinks(gdev);
178 device_unregister(dev); 176 device_unregister(&gdev->dev);
179 __ccwgroup_remove_cdev_refs(gdev); 177 __ccwgroup_remove_cdev_refs(gdev);
180 } 178 }
181 mutex_unlock(&gdev->reg_mutex); 179 mutex_unlock(&gdev->reg_mutex);
@@ -195,10 +193,9 @@ static ssize_t ccwgroup_ungroup_store(struct device *dev,
195 rc = -EINVAL; 193 rc = -EINVAL;
196 goto out; 194 goto out;
197 } 195 }
198 /* Note that we cannot unregister the device from one of its 196
199 * attribute methods, so we have to use this roundabout approach. 197 if (device_remove_file_self(dev, attr))
200 */ 198 ccwgroup_ungroup(gdev);
201 rc = device_schedule_callback(dev, ccwgroup_ungroup_callback);
202out: 199out:
203 if (rc) { 200 if (rc) {
204 if (rc != -EAGAIN) 201 if (rc != -EAGAIN)
@@ -224,6 +221,14 @@ static const struct attribute_group *ccwgroup_attr_groups[] = {
224 NULL, 221 NULL,
225}; 222};
226 223
224static void ccwgroup_ungroup_workfn(struct work_struct *work)
225{
226 struct ccwgroup_device *gdev =
227 container_of(work, struct ccwgroup_device, ungroup_work);
228
229 ccwgroup_ungroup(gdev);
230}
231
227static void ccwgroup_release(struct device *dev) 232static void ccwgroup_release(struct device *dev)
228{ 233{
229 kfree(to_ccwgroupdev(dev)); 234 kfree(to_ccwgroupdev(dev));
@@ -323,6 +328,7 @@ int ccwgroup_create_dev(struct device *parent, struct ccwgroup_driver *gdrv,
323 atomic_set(&gdev->onoff, 0); 328 atomic_set(&gdev->onoff, 0);
324 mutex_init(&gdev->reg_mutex); 329 mutex_init(&gdev->reg_mutex);
325 mutex_lock(&gdev->reg_mutex); 330 mutex_lock(&gdev->reg_mutex);
331 INIT_WORK(&gdev->ungroup_work, ccwgroup_ungroup_workfn);
326 gdev->count = num_devices; 332 gdev->count = num_devices;
327 gdev->dev.bus = &ccwgroup_bus_type; 333 gdev->dev.bus = &ccwgroup_bus_type;
328 gdev->dev.parent = parent; 334 gdev->dev.parent = parent;
@@ -404,10 +410,10 @@ EXPORT_SYMBOL(ccwgroup_create_dev);
404static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action, 410static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action,
405 void *data) 411 void *data)
406{ 412{
407 struct device *dev = data; 413 struct ccwgroup_device *gdev = to_ccwgroupdev(data);
408 414
409 if (action == BUS_NOTIFY_UNBIND_DRIVER) 415 if (action == BUS_NOTIFY_UNBIND_DRIVER)
410 device_schedule_callback(dev, ccwgroup_ungroup_callback); 416 schedule_work(&gdev->ungroup_work);
411 417
412 return NOTIFY_OK; 418 return NOTIFY_OK;
413} 419}