mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-05 00:07:48 -04:00
driver core: attribute_container: change return type to void
attribute_container_register() has always returned 0 since its
introduction in commit 06ff5a987e ("Add attribute container to generic
device model") in the historical Linux tree [1]. Convert the return type
to void and update all callers.
This removes dead code where callers checked for errors that could never
occur.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git [1]
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Link: https://patch.msgid.link/20251220-dev-attribute-container-linux-scsi-v1-1-d58fcd03bf21@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5f62af9fd2
commit
7a96ccc82c
@@ -69,7 +69,7 @@ static DEFINE_MUTEX(attribute_container_mutex);
|
||||
* @cont: The container to register. This must be allocated by the
|
||||
* callee and should also be zeroed by it.
|
||||
*/
|
||||
int
|
||||
void
|
||||
attribute_container_register(struct attribute_container *cont)
|
||||
{
|
||||
INIT_LIST_HEAD(&cont->node);
|
||||
@@ -79,8 +79,6 @@ attribute_container_register(struct attribute_container *cont)
|
||||
mutex_lock(&attribute_container_mutex);
|
||||
list_add_tail(&cont->node, &attribute_container_list);
|
||||
mutex_unlock(&attribute_container_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(attribute_container_register);
|
||||
|
||||
|
||||
@@ -88,17 +88,13 @@ static int anon_transport_dummy_function(struct transport_container *tc,
|
||||
* events. Use prezero and then use DECLARE_ANON_TRANSPORT_CLASS() to
|
||||
* initialise the anon transport class storage.
|
||||
*/
|
||||
int anon_transport_class_register(struct anon_transport_class *atc)
|
||||
void anon_transport_class_register(struct anon_transport_class *atc)
|
||||
{
|
||||
int error;
|
||||
atc->container.class = &atc->tclass.class;
|
||||
attribute_container_set_no_classdevs(&atc->container);
|
||||
error = attribute_container_register(&atc->container);
|
||||
if (error)
|
||||
return error;
|
||||
attribute_container_register(&atc->container);
|
||||
atc->tclass.setup = anon_transport_dummy_function;
|
||||
atc->tclass.remove = anon_transport_dummy_function;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(anon_transport_class_register);
|
||||
|
||||
|
||||
@@ -1622,7 +1622,7 @@ static __init int spi_transport_init(void)
|
||||
error = transport_class_register(&spi_transport_class);
|
||||
if (error)
|
||||
return error;
|
||||
error = anon_transport_class_register(&spi_device_class);
|
||||
anon_transport_class_register(&spi_device_class);
|
||||
return transport_class_register(&spi_host_class);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ attribute_container_set_no_classdevs(struct attribute_container *atc)
|
||||
atc->flags |= ATTRIBUTE_CONTAINER_NO_CLASSDEVS;
|
||||
}
|
||||
|
||||
int attribute_container_register(struct attribute_container *cont);
|
||||
void attribute_container_register(struct attribute_container *cont);
|
||||
int __must_check attribute_container_unregister(struct attribute_container *cont);
|
||||
void attribute_container_create_device(struct device *dev,
|
||||
int (*fn)(struct attribute_container *,
|
||||
|
||||
@@ -87,9 +87,9 @@ transport_unregister_device(struct device *dev)
|
||||
transport_destroy_device(dev);
|
||||
}
|
||||
|
||||
static inline int transport_container_register(struct transport_container *tc)
|
||||
static inline void transport_container_register(struct transport_container *tc)
|
||||
{
|
||||
return attribute_container_register(&tc->ac);
|
||||
attribute_container_register(&tc->ac);
|
||||
}
|
||||
|
||||
static inline void transport_container_unregister(struct transport_container *tc)
|
||||
@@ -99,7 +99,7 @@ static inline void transport_container_unregister(struct transport_container *tc
|
||||
}
|
||||
|
||||
int transport_class_register(struct transport_class *);
|
||||
int anon_transport_class_register(struct anon_transport_class *);
|
||||
void anon_transport_class_register(struct anon_transport_class *);
|
||||
void transport_class_unregister(struct transport_class *);
|
||||
void anon_transport_class_unregister(struct anon_transport_class *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user