Commit ed2ac811 authored by Aishwarya Ramakrishnan's avatar Aishwarya Ramakrishnan Committed by Wolfram Sang

i2c: nvidia-gpu: Use PTR_ERR_OR_ZERO() to simplify code

PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR.

Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: default avatarAishwarya Ramakrishnan <aishwaryarj100@gmail.com>
Reviewed-by: default avatarAjay Gupta <ajayg@nvidia.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent dd4f2ca9
......@@ -277,10 +277,7 @@ static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq)
i2cd->gpu_ccgx_ucsi->irq = irq;
i2cd->gpu_ccgx_ucsi->properties = ccgx_props;
i2cd->ccgx_client = i2c_new_client_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi);
if (IS_ERR(i2cd->ccgx_client))
return PTR_ERR(i2cd->ccgx_client);
return 0;
return PTR_ERR_OR_ZERO(i2cd->ccgx_client);
}
static int gpu_i2c_probe(struct pci_dev *pdev, const struct pci_device_id *id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment