Skip to content

Commit 5415281

Browse files
Niklas Casseldamien-lemoal
authored andcommitted
ata,scsi: remove ata_sas_port_init()
ata_sas_port_init() now only contains a single initialization. Move this single initialization to ata_sas_port_alloc(), since: 1) ata_sas_port_alloc() already initializes some of the struct members. 2) ata_sas_port_alloc() is only used by libsas. Suggested-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent a76f1b6 commit 5415281

3 files changed

Lines changed: 1 addition & 22 deletions

File tree

drivers/ata/libata-sata.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,29 +1139,12 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host,
11391139
ap->flags |= port_info->flags;
11401140
ap->ops = port_info->port_ops;
11411141
ap->cbl = ATA_CBL_SATA;
1142+
ap->print_id = atomic_inc_return(&ata_print_id);
11421143

11431144
return ap;
11441145
}
11451146
EXPORT_SYMBOL_GPL(ata_sas_port_alloc);
11461147

1147-
/**
1148-
* ata_sas_port_init - Initialize a SATA device
1149-
* @ap: SATA port to initialize
1150-
*
1151-
* LOCKING:
1152-
* PCI/etc. bus probe sem.
1153-
*
1154-
* RETURNS:
1155-
* Zero on success, non-zero on error.
1156-
*/
1157-
1158-
int ata_sas_port_init(struct ata_port *ap)
1159-
{
1160-
ap->print_id = atomic_inc_return(&ata_print_id);
1161-
return 0;
1162-
}
1163-
EXPORT_SYMBOL_GPL(ata_sas_port_init);
1164-
11651148
int ata_sas_tport_add(struct device *parent, struct ata_port *ap)
11661149
{
11671150
return ata_tport_add(parent, ap);

drivers/scsi/libsas/sas_ata.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,6 @@ int sas_ata_init(struct domain_device *found_dev)
605605
ap->private_data = found_dev;
606606
ap->cbl = ATA_CBL_SATA;
607607
ap->scsi_host = shost;
608-
rc = ata_sas_port_init(ap);
609-
if (rc)
610-
goto destroy_port;
611608

612609
rc = ata_sas_tport_add(ata_host->dev, ap);
613610
if (rc)

include/linux/libata.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,6 @@ extern int ata_slave_link_init(struct ata_port *ap);
12411241
extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
12421242
struct ata_port_info *, struct Scsi_Host *);
12431243
extern void ata_port_probe(struct ata_port *ap);
1244-
extern int ata_sas_port_init(struct ata_port *);
12451244
extern int ata_sas_tport_add(struct device *parent, struct ata_port *ap);
12461245
extern void ata_sas_tport_delete(struct ata_port *ap);
12471246
extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *);

0 commit comments

Comments
 (0)