summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuan Jinjie <ruanjinjie@huawei.com>2023-08-17 10:24:18 +0800
committerJakub Kicinski <kuba@kernel.org>2023-08-18 15:32:52 -0700
commit829b3357dd9737d45b3724b5378adf8cf8334ea1 (patch)
treea6dd6a99ac67476abeeed65431beec669fd69dc4
parentee09e9deefac842a66cbbd39fd2f03aff6e2a656 (diff)
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@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/20230817022418.3588831-1-ruanjinjie@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/davicom/dm9051.c5
1 files changed, 1 insertions, 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, &regconfigdmbulk);
- 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)