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
Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
simplify code.

Signed-off-by: Ruan Jinjie <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Ruan Jinjie authored and kuba-moo committed Aug 18, 2023
1 parent ee09e9d commit 829b335
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/ethernet/davicom/dm9051.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 829b335

Please sign in to comment.