diff options
author | Aishwarya Ramakrishnan <aishwaryarj100@gmail.com> | 2020-05-05 20:22:30 +0530 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2020-05-27 12:07:34 +0200 |
commit | ed2ac8116ff25d5b234f983ffbb0c3f5ec2930aa (patch) | |
tree | 3d8a0e147801218829a23b2104065dd718e7bff9 /drivers/i2c | |
parent | dd4f2ca965ecd72f181c81e84c5cb89950405d38 (diff) | |
download | linux-ed2ac8116ff25d5b234f983ffbb0c3f5ec2930aa.tar.bz2 |
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: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-nvidia-gpu.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c index f5d25ce00f03..f480105000b8 100644 --- a/drivers/i2c/busses/i2c-nvidia-gpu.c +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c @@ -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) |