Skip to content

Commit 6a36d82

Browse files
Dr. David Alan Gilbertgregkh
authored andcommitted
driver core: attribute_container: Remove unused functions
I can't find any use of 'attribute_container_add_class_device_adapter' or 'attribute_container_trigger' in git history. Their export decls went in 2006: commit 1740757 ("[PATCH] Driver Core: remove unused exports") and their docs disappeared in 2016: commit 47cb398 ("Docs: sphinxify device-drivers.tmpl") Remove them. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent efb0b30 commit 6a36d82

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

drivers/base/attribute_container.c

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ attribute_container_device_trigger_safe(struct device *dev,
346346
* @fn: the function to execute for each classdev.
347347
*
348348
* This function is for executing a trigger when you need to know both
349-
* the container and the classdev. If you only care about the
350-
* container, then use attribute_container_trigger() instead.
349+
* the container and the classdev.
351350
*/
352351
void
353352
attribute_container_device_trigger(struct device *dev,
@@ -378,33 +377,6 @@ attribute_container_device_trigger(struct device *dev,
378377
mutex_unlock(&attribute_container_mutex);
379378
}
380379

381-
/**
382-
* attribute_container_trigger - trigger a function for each matching container
383-
*
384-
* @dev: The generic device to activate the trigger for
385-
* @fn: the function to trigger
386-
*
387-
* This routine triggers a function that only needs to know the
388-
* matching containers (not the classdev) associated with a device.
389-
* It is more lightweight than attribute_container_device_trigger, so
390-
* should be used in preference unless the triggering function
391-
* actually needs to know the classdev.
392-
*/
393-
void
394-
attribute_container_trigger(struct device *dev,
395-
int (*fn)(struct attribute_container *,
396-
struct device *))
397-
{
398-
struct attribute_container *cont;
399-
400-
mutex_lock(&attribute_container_mutex);
401-
list_for_each_entry(cont, &attribute_container_list, node) {
402-
if (cont->match(cont, dev))
403-
fn(cont, dev);
404-
}
405-
mutex_unlock(&attribute_container_mutex);
406-
}
407-
408380
/**
409381
* attribute_container_add_attrs - add attributes
410382
*
@@ -458,24 +430,6 @@ attribute_container_add_class_device(struct device *classdev)
458430
return attribute_container_add_attrs(classdev);
459431
}
460432

461-
/**
462-
* attribute_container_add_class_device_adapter - simple adapter for triggers
463-
*
464-
* @cont: the container to register.
465-
* @dev: the generic device to activate the trigger for
466-
* @classdev: the class device to add
467-
*
468-
* This function is identical to attribute_container_add_class_device except
469-
* that it is designed to be called from the triggers
470-
*/
471-
int
472-
attribute_container_add_class_device_adapter(struct attribute_container *cont,
473-
struct device *dev,
474-
struct device *classdev)
475-
{
476-
return attribute_container_add_class_device(classdev);
477-
}
478-
479433
/**
480434
* attribute_container_remove_attrs - remove any attribute files
481435
*

include/linux/attribute_container.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,8 @@ int attribute_container_device_trigger_safe(struct device *dev,
6161
int (*undo)(struct attribute_container *,
6262
struct device *,
6363
struct device *));
64-
void attribute_container_trigger(struct device *dev,
65-
int (*fn)(struct attribute_container *,
66-
struct device *));
6764
int attribute_container_add_attrs(struct device *classdev);
6865
int attribute_container_add_class_device(struct device *classdev);
69-
int attribute_container_add_class_device_adapter(struct attribute_container *cont,
70-
struct device *dev,
71-
struct device *classdev);
7266
void attribute_container_remove_attrs(struct device *classdev);
7367
void attribute_container_class_device_del(struct device *classdev);
7468
struct attribute_container *attribute_container_classdev_to_container(struct device *);

0 commit comments

Comments
 (0)