diff options
author | Yu Liao <liaoyu15@huawei.com> | 2023-08-22 10:14:55 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-23 18:57:30 -0700 |
commit | 664c84c26d7a77d4b19813831466d67253f2326e (patch) | |
tree | 010919ddc60c75ef97f39ad19bc6af1d49f49d51 /drivers/net/ethernet/davicom | |
parent | e3b3a87967cef1fa157d93fd726960b1b812401d (diff) |
net: dm9051: Use PTR_ERR_OR_ZERO() to simplify code
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>
Diffstat (limited to 'drivers/net/ethernet/davicom')
-rw-r--r-- | drivers/net/ethernet/davicom/dm9051.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/davicom/dm9051.c b/drivers/net/ethernet/davicom/dm9051.c index 2caaf1e9f42f..bcfe52c11804 100644 --- a/drivers/net/ethernet/davicom/dm9051.c +++ b/drivers/net/ethernet/davicom/dm9051.c @@ -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) |