diff options
author | Tang Bin <tangbin@cmss.chinamobile.com> | 2020-05-07 13:12:24 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-15 16:25:20 +0200 |
commit | 0548745fa335a4665b039b9fd8e121339932c24b (patch) | |
tree | 26e56ce9bf4f0060d3075e74766d606af7554fe1 | |
parent | w1: ds2430: fix eeprom size in driver description (diff) | |
download | linux-0548745fa335a4665b039b9fd8e121339932c24b.tar.xz linux-0548745fa335a4665b039b9fd8e121339932c24b.zip |
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 <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200507111224.4176-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/dca/dca-sysfs.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c index eb25627b059d..21ebd0af268b 100644 --- a/drivers/dca/dca-sysfs.c +++ b/drivers/dca/dca-sysfs.c @@ -24,9 +24,7 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL, "requester%d", req_count++); - if (IS_ERR(cd)) - return PTR_ERR(cd); - return 0; + return PTR_ERR_OR_ZERO(cd); } void dca_sysfs_remove_req(struct dca_provider *dca, int slot) |