Skip to content

Commit

Permalink
net: dm9051: Use PTR_ERR_OR_ZERO() to simplify code
Browse files Browse the repository at this point in the history
Use the standard error pointer macro to shorten the code and simplify.

Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Link: https://lore.kernel.org/r/20230822021455.205101-2-liaoyu15@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Yu Liao authored and Jakub Kicinski committed Aug 24, 2023
1 parent e3b3a87 commit 664c84c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/davicom/dm9051.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,9 +1158,7 @@ static int dm9051_phy_connect(struct board_info *db)

db->phydev = phy_connect(db->ndev, phy_id, dm9051_handle_link_change,
PHY_INTERFACE_MODE_MII);
if (IS_ERR(db->phydev))
return PTR_ERR_OR_ZERO(db->phydev);
return 0;
return PTR_ERR_OR_ZERO(db->phydev);
}

static int dm9051_probe(struct spi_device *spi)
Expand Down

0 comments on commit 664c84c

Please sign in to comment.