Commit 1c8ee06b authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Hans de Goede
Browse files

platform/mellanox: Remove unnecessary code



Remove redundant 'NULL' check for of if 'data->notifier'.

Replace 'return err' by 'return 0' in mlxreg_lc_probe().

Fixes: 62f9529b ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
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-4-vadimp@nvidia.com


Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 52e01c0b
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -825,10 +825,9 @@ static int mlxreg_lc_probe(struct platform_device *pdev)


	mutex_init(&mlxreg_lc->lock);
	mutex_init(&mlxreg_lc->lock);
	/* Set event notification callback. */
	/* Set event notification callback. */
	if (data->notifier) {
	data->notifier->user_handler = mlxreg_lc_event_handler;
	data->notifier->user_handler = mlxreg_lc_event_handler;
	data->notifier->handle = mlxreg_lc;
	data->notifier->handle = mlxreg_lc;
	}

	data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr);
	data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr);
	if (!data->hpdev.adapter) {
	if (!data->hpdev.adapter) {
		dev_err(&pdev->dev, "Failed to get adapter for bus %d\n",
		dev_err(&pdev->dev, "Failed to get adapter for bus %d\n",
@@ -888,7 +887,7 @@ static int mlxreg_lc_probe(struct platform_device *pdev)
	if (err)
	if (err)
		goto mlxreg_lc_config_init_fail;
		goto mlxreg_lc_config_init_fail;


	return err;
	return 0;


mlxreg_lc_config_init_fail:
mlxreg_lc_config_init_fail:
regcache_sync_fail:
regcache_sync_fail: