Commit 829b3357 authored by Ruan Jinjie's avatar Ruan Jinjie Committed by Jakub Kicinski

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: default avatarRuan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20230817022418.3588831-1-ruanjinjie@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ee09e9de
...@@ -510,10 +510,7 @@ static int dm9051_map_init(struct spi_device *spi, struct board_info *db) ...@@ -510,10 +510,7 @@ static int dm9051_map_init(struct spi_device *spi, struct board_info *db)
regconfigdmbulk.lock_arg = db; regconfigdmbulk.lock_arg = db;
db->regmap_dmbulk = devm_regmap_init_spi(db->spidev, &regconfigdmbulk); db->regmap_dmbulk = devm_regmap_init_spi(db->spidev, &regconfigdmbulk);
if (IS_ERR(db->regmap_dmbulk)) return PTR_ERR_OR_ZERO(db->regmap_dmbulk);
return PTR_ERR(db->regmap_dmbulk);
return 0;
} }
static int dm9051_map_chipid(struct board_info *db) static int dm9051_map_chipid(struct board_info *db)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment