diff options
author | Samuel Zou <zou_wei@huawei.com> | 2020-05-06 10:54:58 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-06 13:43:53 -0700 |
commit | bbae62e32ee9ef3995cb72e565dd8790a6858de2 (patch) | |
tree | 5db1f96a97fb42db019283b25e0a604eaed0838e /drivers | |
parent | 01241aa000ab0a685062a448b0d7d97f470f446f (diff) |
net: ethernet: ti: Use PTR_ERR_OR_ZERO() to simplify code
Fixes coccicheck warning:
drivers/net/ethernet/ti/am65-cpts.c:1017:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Samuel Zou <zou_wei@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/ti/am65-cpts.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c index 370162c86e7f..51c94b2a77b1 100644 --- a/drivers/net/ethernet/ti/am65-cpts.c +++ b/drivers/net/ethernet/ti/am65-cpts.c @@ -1014,10 +1014,7 @@ static int am65_cpts_probe(struct platform_device *pdev) return PTR_ERR(base); cpts = am65_cpts_create(dev, base, node); - if (IS_ERR(cpts)) - return PTR_ERR(cpts); - - return 0; + return PTR_ERR_OR_ZERO(cpts); } static const struct of_device_id am65_cpts_of_match[] = { |