[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230817022418.3588831-1-ruanjinjie@huawei.com>
Date: Thu, 17 Aug 2023 10:24:18 +0800
From: Ruan Jinjie <ruanjinjie@...wei.com>
To: <netdev@...r.kernel.org>, "David S. Miller" <davem@...emloft.net>, Eric
Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH net-next v2] net: dm9051: Use PTR_ERR_OR_ZERO() to simplify code
Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
simplify code.
Signed-off-by: Ruan Jinjie <ruanjinjie@...wei.com>
Reviewed-by: Leon Romanovsky <leonro@...dia.com>
---
v2:
- Update the subject prefix.
---
drivers/net/ethernet/davicom/dm9051.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/davicom/dm9051.c b/drivers/net/ethernet/davicom/dm9051.c
index 70728b2e5f18..2caaf1e9f42f 100644
--- a/drivers/net/ethernet/davicom/dm9051.c
+++ b/drivers/net/ethernet/davicom/dm9051.c
@@ -510,10 +510,7 @@ static int dm9051_map_init(struct spi_device *spi, struct board_info *db)
regconfigdmbulk.lock_arg = db;
db->regmap_dmbulk = devm_regmap_init_spi(db->spidev, ®configdmbulk);
- if (IS_ERR(db->regmap_dmbulk))
- return PTR_ERR(db->regmap_dmbulk);
-
- return 0;
+ return PTR_ERR_OR_ZERO(db->regmap_dmbulk);
}
static int dm9051_map_chipid(struct board_info *db)
--
2.34.1
Powered by blists - more mailing lists