diff options
Diffstat (limited to 'include/linux/transport_class.h')
| -rw-r--r-- | include/linux/transport_class.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/transport_class.h b/include/linux/transport_class.h index 11087cdd4ad3..2efc271a96fa 100644 --- a/include/linux/transport_class.h +++ b/include/linux/transport_class.h @@ -1,9 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * transport_class.h - a generic container for all transport classes * * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com> - * - * This file is licensed under GPLv2 */ #ifndef _TRANSPORT_CLASS_H_ @@ -63,16 +62,22 @@ struct transport_container { container_of(x, struct transport_container, ac) void transport_remove_device(struct device *); -void transport_add_device(struct device *); +int transport_add_device(struct device *); void transport_setup_device(struct device *); void transport_configure_device(struct device *); void transport_destroy_device(struct device *); -static inline void +static inline int transport_register_device(struct device *dev) { + int ret; + transport_setup_device(dev); - transport_add_device(dev); + ret = transport_add_device(dev); + if (ret) + transport_destroy_device(dev); + + return ret; } static inline void |
