Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 1740757e8f94 ("[PATCH] Driver Core: remove unused exports")

and their docs disappeared in 2016:
commit 47cb398dd75a ("Docs: sphinxify device-drivers.tmpl")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20240913010955.1393995-1-linux@treblig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dr. David Alan Gilbert and committed by
Greg Kroah-Hartman
6a36d828 efb0b309

+1 -53
+1 -47
drivers/base/attribute_container.c
··· 346 346 * @fn: the function to execute for each classdev. 347 347 * 348 348 * 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. 351 350 */ 352 351 void 353 352 attribute_container_device_trigger(struct device *dev, ··· 373 374 if (dev == ic->classdev.parent) 374 375 fn(cont, dev, &ic->classdev); 375 376 } 376 - } 377 - mutex_unlock(&attribute_container_mutex); 378 - } 379 - 380 - /** 381 - * attribute_container_trigger - trigger a function for each matching container 382 - * 383 - * @dev: The generic device to activate the trigger for 384 - * @fn: the function to trigger 385 - * 386 - * This routine triggers a function that only needs to know the 387 - * matching containers (not the classdev) associated with a device. 388 - * It is more lightweight than attribute_container_device_trigger, so 389 - * should be used in preference unless the triggering function 390 - * actually needs to know the classdev. 391 - */ 392 - void 393 - attribute_container_trigger(struct device *dev, 394 - int (*fn)(struct attribute_container *, 395 - struct device *)) 396 - { 397 - struct attribute_container *cont; 398 - 399 - mutex_lock(&attribute_container_mutex); 400 - list_for_each_entry(cont, &attribute_container_list, node) { 401 - if (cont->match(cont, dev)) 402 - fn(cont, dev); 403 377 } 404 378 mutex_unlock(&attribute_container_mutex); 405 379 } ··· 428 456 if (error) 429 457 return error; 430 458 return attribute_container_add_attrs(classdev); 431 - } 432 - 433 - /** 434 - * attribute_container_add_class_device_adapter - simple adapter for triggers 435 - * 436 - * @cont: the container to register. 437 - * @dev: the generic device to activate the trigger for 438 - * @classdev: the class device to add 439 - * 440 - * This function is identical to attribute_container_add_class_device except 441 - * that it is designed to be called from the triggers 442 - */ 443 - int 444 - attribute_container_add_class_device_adapter(struct attribute_container *cont, 445 - struct device *dev, 446 - struct device *classdev) 447 - { 448 - return attribute_container_add_class_device(classdev); 449 459 } 450 460 451 461 /**
-6
include/linux/attribute_container.h
··· 61 61 int (*undo)(struct attribute_container *, 62 62 struct device *, 63 63 struct device *)); 64 - void attribute_container_trigger(struct device *dev, 65 - int (*fn)(struct attribute_container *, 66 - struct device *)); 67 64 int attribute_container_add_attrs(struct device *classdev); 68 65 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); 72 66 void attribute_container_remove_attrs(struct device *classdev); 73 67 void attribute_container_class_device_del(struct device *classdev); 74 68 struct attribute_container *attribute_container_classdev_to_container(struct device *);