Skip to content

Commit 0548745

Browse files
Tang Bingregkh
authored andcommitted
dca: Use PTR_ERR_OR_ZERO() to simplify code
The function PTR_ERR_OR_ZERO() contains the check of IS_ERR() and the return of PTR_ERR() or zero. Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: Tang Bin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cafa1a5 commit 0548745

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/dca/dca-sysfs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
2424

2525
cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL,
2626
"requester%d", req_count++);
27-
if (IS_ERR(cd))
28-
return PTR_ERR(cd);
29-
return 0;
27+
return PTR_ERR_OR_ZERO(cd);
3028
}
3129

3230
void dca_sysfs_remove_req(struct dca_provider *dca, int slot)

0 commit comments

Comments
 (0)