summaryrefslogtreecommitdiff
path: root/drivers/staging/gasket/gasket_sysfs.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-13 10:29:04 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-14 09:17:24 +0200
commit2e008cd075ba8c2b2212b9e8f3c75d79fa1ee44b (patch)
tree582950476f9947ad4cddc4ee42d91b05151b3785 /drivers/staging/gasket/gasket_sysfs.c
parent3adb0e35a4d86b442a55eabfa6ab7b67059e514f (diff)
staging: gasket: sysfs: remove legacy_device field
This field is only ever checked, never actually set, and looks to be left-over from some old interface of some sort. As it's not being used at all here, and is just adding to the complexity, delete it. Cc: Rob Springer <rspringer@google.com> Cc: John Joseph <jnjoseph@google.com> Cc: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gasket/gasket_sysfs.c')
-rw-r--r--drivers/staging/gasket/gasket_sysfs.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/staging/gasket/gasket_sysfs.c b/drivers/staging/gasket/gasket_sysfs.c
index 39f9595c85e8..e3d770630961 100644
--- a/drivers/staging/gasket/gasket_sysfs.c
+++ b/drivers/staging/gasket/gasket_sysfs.c
@@ -17,9 +17,6 @@ struct gasket_sysfs_mapping {
*/
struct device *device;
- /* Legacy device struct, if used by this mapping's driver. */
- struct device *legacy_device;
-
/* The Gasket descriptor for this device. */
struct gasket_dev *gasket_dev;
@@ -75,8 +72,7 @@ static struct gasket_sysfs_mapping *get_mapping(struct device *device)
for (i = 0; i < GASKET_SYSFS_NUM_MAPPINGS; i++) {
mutex_lock(&dev_mappings[i].mutex);
- if (dev_mappings[i].device == device ||
- dev_mappings[i].legacy_device == device) {
+ if (dev_mappings[i].device == device) {
kref_get(&dev_mappings[i].refcount);
mutex_unlock(&dev_mappings[i].mutex);
return &dev_mappings[i];
@@ -105,7 +101,6 @@ static void put_mapping(struct gasket_sysfs_mapping *mapping)
int num_files_to_remove = 0;
struct device_attribute *files_to_remove;
struct device *device;
- struct device *legacy_device;
if (!mapping) {
gasket_nodev_info("Mapping should not be NULL.");
@@ -126,7 +121,6 @@ static void put_mapping(struct gasket_sysfs_mapping *mapping)
* sysfs nodes are removed outside the lock.
*/
device = mapping->device;
- legacy_device = mapping->legacy_device;
num_files_to_remove = mapping->attribute_count;
files_to_remove = kcalloc(num_files_to_remove,
sizeof(*files_to_remove),
@@ -143,12 +137,8 @@ static void put_mapping(struct gasket_sysfs_mapping *mapping)
mutex_unlock(&mapping->mutex);
if (num_files_to_remove != 0) {
- for (i = 0; i < num_files_to_remove; ++i) {
+ for (i = 0; i < num_files_to_remove; ++i)
device_remove_file(device, &files_to_remove[i]);
- if (legacy_device)
- device_remove_file(
- legacy_device, &files_to_remove[i]);
- }
kfree(files_to_remove);
}
}
@@ -282,21 +272,6 @@ int gasket_sysfs_create_entries(
return ret;
}
- if (mapping->legacy_device) {
- ret = device_create_file(mapping->legacy_device,
- &attrs[i].attr);
- if (ret) {
- gasket_log_error(
- mapping->gasket_dev,
- "Unable to create legacy sysfs entries;"
- " rc: %d",
- ret);
- mutex_unlock(&mapping->mutex);
- put_mapping(mapping);
- return ret;
- }
- }
-
mapping->attributes[mapping->attribute_count] = attrs[i];
++mapping->attribute_count;
}