Commit 791ae8e8 authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Hans de Goede

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: b4b830a3  ("platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20220823201937.46855-5-vadimp@nvidia.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 2f92fdd0
...@@ -893,10 +893,8 @@ static int mlxreg_lc_probe(struct platform_device *pdev) ...@@ -893,10 +893,8 @@ static int mlxreg_lc_probe(struct platform_device *pdev)
regcache_sync_fail: regcache_sync_fail:
regmap_write_fail: regmap_write_fail:
devm_regmap_init_i2c_fail: devm_regmap_init_i2c_fail:
if (data->hpdev.client) {
i2c_unregister_device(data->hpdev.client); i2c_unregister_device(data->hpdev.client);
data->hpdev.client = NULL; data->hpdev.client = NULL;
}
i2c_new_device_fail: i2c_new_device_fail:
i2c_put_adapter(data->hpdev.adapter); i2c_put_adapter(data->hpdev.adapter);
data->hpdev.adapter = NULL; data->hpdev.adapter = NULL;
......
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