aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Pasternak <vadimp@nvidia.com>2022-08-23 23:19:37 +0300
committerHans de Goede <hdegoede@redhat.com>2022-09-01 14:20:50 +0200
commit059209fd902f5ad4bec8124931c258e62fddf74f (patch)
tree32781983adf5d38982a88757f1364b24f6bec2f3
parentplatform/mellanox: Remove unnecessary code (diff)
downloadlinux-dev-059209fd902f5ad4bec8124931c258e62fddf74f.tar.xz
linux-dev-059209fd902f5ad4bec8124931c258e62fddf74f.zip
platform/mellanox: Remove redundant 'NULL' check
Remove 'NULL' check for 'data->hpdev.client' in error flow of mlxreg_lc_probe(). It cannot be 'NULL' at this point. Fixes: b4b830a34d80 ("platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20220823201937.46855-5-vadimp@nvidia.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/platform/mellanox/mlxreg-lc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/platform/mellanox/mlxreg-lc.c b/drivers/platform/mellanox/mlxreg-lc.c
index 1e0c3ddc46cd..1e071df4c9f5 100644
--- a/drivers/platform/mellanox/mlxreg-lc.c
+++ b/drivers/platform/mellanox/mlxreg-lc.c
@@ -893,10 +893,8 @@ mlxreg_lc_config_init_fail:
regcache_sync_fail:
regmap_write_fail:
devm_regmap_init_i2c_fail:
- if (data->hpdev.client) {
- i2c_unregister_device(data->hpdev.client);
- data->hpdev.client = NULL;
- }
+ i2c_unregister_device(data->hpdev.client);
+ data->hpdev.client = NULL;
i2c_new_device_fail:
i2c_put_adapter(data->hpdev.adapter);
data->hpdev.adapter = NULL;