Skip to content

Commit

Permalink
ata: libahci: Clean-up the ahci_platform_en/disable_phys functions
Browse files Browse the repository at this point in the history
The phy_ functions handle the NULL pointer case, so there is no need
to skip them if there is a NULL pointer. Moreover, after the error
label there is already no check on the pointer. This patch removes the
unnecessary tests and brings some consistency.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Gregory CLEMENT authored and Tejun Heo committed Jan 19, 2015
1 parent 5bc27ef commit 6033798
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/ata/libahci_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ static int ahci_platform_enable_phys(struct ahci_host_priv *hpriv)
int rc, i;

for (i = 0; i < hpriv->nports; i++) {
if (!hpriv->phys[i])
continue;

rc = phy_init(hpriv->phys[i]);
if (rc)
goto disable_phys;
Expand Down Expand Up @@ -89,9 +86,6 @@ static void ahci_platform_disable_phys(struct ahci_host_priv *hpriv)
int i;

for (i = 0; i < hpriv->nports; i++) {
if (!hpriv->phys[i])
continue;

phy_power_off(hpriv->phys[i]);
phy_exit(hpriv->phys[i]);
}
Expand Down

0 comments on commit 6033798

Please sign in to comment.