Skip to content

Commit 829b335

Browse files
Ruan Jinjiekuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ee09e9d commit 829b335

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/net/ethernet/davicom/dm9051.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,7 @@ static int dm9051_map_init(struct spi_device *spi, struct board_info *db)
510510

511511
regconfigdmbulk.lock_arg = db;
512512
db->regmap_dmbulk = devm_regmap_init_spi(db->spidev, &regconfigdmbulk);
513-
if (IS_ERR(db->regmap_dmbulk))
514-
return PTR_ERR(db->regmap_dmbulk);
515-
516-
return 0;
513+
return PTR_ERR_OR_ZERO(db->regmap_dmbulk);
517514
}
518515

519516
static int dm9051_map_chipid(struct board_info *db)

0 commit comments

Comments
 (0)