From: Heiner Kallweit <hkallweit1@gmail.com>
To: Damien Le Moal <dlemoal@kernel.org>, Niklas Cassel <cassel@kernel.org>
Cc: linux-ide@vger.kernel.org
Subject: [PATCH v2 2/5] ata: libata-transport: inline ata_attach|release_transport
Date: Thu, 2 Apr 2026 15:30:05 +0200 [thread overview]
Message-ID: <6a1f8c7c-3be6-490d-ad4f-4ad1349e7f32@gmail.com> (raw)
In-Reply-To: <93fc6c62-ed8c-4953-ad7b-522031bb7ed9@gmail.com>
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>
---
drivers/ata/libata-core.c | 2 --
drivers/ata/libata-transport.c | 34 +++++++++++-----------------------
drivers/ata/libata-transport.h | 3 ---
3 files changed, 11 insertions(+), 28 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ae56567af..e76d15411 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -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();
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index 0c7ce278e..9d594562c 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -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);
diff --git a/drivers/ata/libata-transport.h b/drivers/ata/libata-transport.h
index a464b8fcd..fe5ca66fc 100644
--- a/drivers/ata/libata-transport.h
+++ b/drivers/ata/libata-transport.h
@@ -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
--
2.53.0
next prev parent reply other threads:[~2026-04-02 13:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 13:28 [PATCH v2 0/5] ata: libata-transport: series with further refactorings Heiner Kallweit
2026-04-02 13:29 ` [PATCH v2 1/5] ata: libata-transport: instantiate struct ata_internal statically Heiner Kallweit
2026-04-02 13:30 ` Heiner Kallweit [this message]
2026-04-02 13:30 ` [PATCH v2 3/5] ata: libata-transport: use static struct ata_transport_internal to simplify match functions Heiner Kallweit
2026-04-02 13:31 ` [PATCH v2 4/5] ata: libata-transport: split struct ata_internal Heiner Kallweit
2026-04-02 13:32 ` [PATCH v2 5/5] ata: libata-transport: remove static variable ata_scsi_transport_template Heiner Kallweit
2026-04-02 19:03 ` [PATCH v2 0/5] ata: libata-transport: series with further refactorings Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a1f8c7c-3be6-490d-ad4f-4ad1349e7f32@gmail.com \
--to=hkallweit1@gmail.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox