diff options
| author | Damien Le Moal <dlemoal@kernel.org> | 2025-01-06 14:14:47 +0900 |
|---|---|---|
| committer | Damien Le Moal <dlemoal@kernel.org> | 2025-01-09 17:52:17 +0900 |
| commit | c9b5be909e6595547ed5d45aef39fd65948aa342 (patch) | |
| tree | 138818e7a1506a243909ed767dede15744b808c9 /drivers/ata/ahci_ceva.c | |
| parent | 8c87215dd3a2c814dcffc0bafe8c80c8f98f2574 (diff) | |
ahci: Introduce ahci_ignore_port() helper
libahci and AHCI drivers may ignore some ports if the port is invalid
(its ID does not correspond to a valid physical port) or if the user
explicitly requested the port to be ignored with the mask_port_map
ahci module parameter. Such port that shall be ignored can be identified
by checking that the bit corresponding to the port ID is not set in the
mask_port_map field of struct ahci_host_priv. E.g. code such as:
"if (!(hpriv->mask_port_map & (1 << portid)))".
Replace all direct use of the mask_port_map field to detect such port
with the new helper inline function ahci_ignore_port() to make the code
more readable/easier to understand.
The comment describing the mask_port_map field of struct ahci_host_priv
is also updated to be more accurate.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'drivers/ata/ahci_ceva.c')
| -rw-r--r-- | drivers/ata/ahci_ceva.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c index f2e20ed11ec7..2d6a08c23d6a 100644 --- a/drivers/ata/ahci_ceva.c +++ b/drivers/ata/ahci_ceva.c @@ -206,7 +206,7 @@ static int ceva_ahci_platform_enable_resources(struct ahci_host_priv *hpriv) goto disable_clks; for (i = 0; i < hpriv->nports; i++) { - if (!(hpriv->mask_port_map & (1 << i))) + if (ahci_ignore_port(hpriv, i)) continue; rc = phy_init(hpriv->phys[i]); @@ -218,7 +218,7 @@ static int ceva_ahci_platform_enable_resources(struct ahci_host_priv *hpriv) ahci_platform_deassert_rsts(hpriv); for (i = 0; i < hpriv->nports; i++) { - if (!(hpriv->mask_port_map & (1 << i))) + if (ahci_ignore_port(hpriv, i)) continue; rc = phy_power_on(hpriv->phys[i]); |
