mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
ata: libata-transport: inline ata_attach|release_transport
Both functions are helpers which are used only once. So remove them and merge their code into libata_transport_init() and libata_transport_exit() respectively. Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Niklas Cassel <cassel@kernel.org>
This commit is contained in:
parent
ee1ed7a864
commit
f212246539
|
|
@ -6778,7 +6778,6 @@ static int __init ata_init(void)
|
|||
}
|
||||
|
||||
libata_transport_init();
|
||||
ata_scsi_transport_template = ata_attach_transport();
|
||||
|
||||
printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n");
|
||||
|
||||
|
|
@ -6787,7 +6786,6 @@ static int __init ata_init(void)
|
|||
|
||||
static void __exit ata_exit(void)
|
||||
{
|
||||
ata_release_transport();
|
||||
libata_transport_exit();
|
||||
ata_sff_exit();
|
||||
ata_free_force_param();
|
||||
|
|
|
|||
|
|
@ -766,29 +766,6 @@ static struct ata_internal ata_transport_internal = {
|
|||
* Setup / Teardown code
|
||||
*/
|
||||
|
||||
/**
|
||||
* ata_attach_transport -- instantiate ATA transport template
|
||||
*/
|
||||
struct scsi_transport_template *ata_attach_transport(void)
|
||||
{
|
||||
transport_container_register(&ata_transport_internal.t.host_attrs);
|
||||
transport_container_register(&ata_transport_internal.link_attr_cont);
|
||||
transport_container_register(&ata_transport_internal.dev_attr_cont);
|
||||
|
||||
return &ata_transport_internal.t;
|
||||
}
|
||||
|
||||
/**
|
||||
* ata_release_transport -- release ATA transport template instance
|
||||
* @t: transport template instance
|
||||
*/
|
||||
void ata_release_transport(void)
|
||||
{
|
||||
transport_container_unregister(&ata_transport_internal.t.host_attrs);
|
||||
transport_container_unregister(&ata_transport_internal.link_attr_cont);
|
||||
transport_container_unregister(&ata_transport_internal.dev_attr_cont);
|
||||
}
|
||||
|
||||
__init int libata_transport_init(void)
|
||||
{
|
||||
int error;
|
||||
|
|
@ -802,6 +779,13 @@ __init int libata_transport_init(void)
|
|||
error = transport_class_register(&ata_dev_class);
|
||||
if (error)
|
||||
goto out_unregister_port;
|
||||
|
||||
transport_container_register(&ata_transport_internal.t.host_attrs);
|
||||
transport_container_register(&ata_transport_internal.link_attr_cont);
|
||||
transport_container_register(&ata_transport_internal.dev_attr_cont);
|
||||
|
||||
ata_scsi_transport_template = &ata_transport_internal.t;
|
||||
|
||||
return 0;
|
||||
|
||||
out_unregister_port:
|
||||
|
|
@ -815,6 +799,10 @@ __init int libata_transport_init(void)
|
|||
|
||||
void __exit libata_transport_exit(void)
|
||||
{
|
||||
transport_container_unregister(&ata_transport_internal.t.host_attrs);
|
||||
transport_container_unregister(&ata_transport_internal.link_attr_cont);
|
||||
transport_container_unregister(&ata_transport_internal.dev_attr_cont);
|
||||
|
||||
transport_class_unregister(&ata_link_class);
|
||||
transport_class_unregister(&ata_port_class);
|
||||
transport_class_unregister(&ata_dev_class);
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ extern struct scsi_transport_template *ata_scsi_transport_template;
|
|||
int ata_tlink_add(struct ata_link *link);
|
||||
void ata_tlink_delete(struct ata_link *link);
|
||||
|
||||
struct scsi_transport_template *ata_attach_transport(void);
|
||||
void ata_release_transport(void);
|
||||
|
||||
__init int libata_transport_init(void);
|
||||
void __exit libata_transport_exit(void);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user