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>
This commit is contained in:
Родитель
cafa1a5b22
Коммит
0548745fa3
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче