]> git.baikalelectronics.ru Git - kernel.git/commitdiff
platform/mellanox: Remove unnecessary code
authorVadim Pasternak <vadimp@nvidia.com>
Tue, 23 Aug 2022 20:19:36 +0000 (23:19 +0300)
committerHans de Goede <hdegoede@redhat.com>
Thu, 1 Sep 2022 12:22:48 +0000 (14:22 +0200)
Remove redundant 'NULL' check for of if 'data->notifier'.

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

Fixes: 62f9529b8d5c87b ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20220823201937.46855-4-vadimp@nvidia.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/mellanox/mlxreg-lc.c

index e578c7bc060bbf93afb380228687f1ffa5636804..1e0c3ddc46cdcd8749a6c0f6c32da4532e7698f6 100644 (file)
@@ -825,10 +825,9 @@ static int mlxreg_lc_probe(struct platform_device *pdev)
 
        mutex_init(&mlxreg_lc->lock);
        /* Set event notification callback. */
-       if (data->notifier) {
-               data->notifier->user_handler = mlxreg_lc_event_handler;
-               data->notifier->handle = mlxreg_lc;
-       }
+       data->notifier->user_handler = mlxreg_lc_event_handler;
+       data->notifier->handle = mlxreg_lc;
+
        data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr);
        if (!data->hpdev.adapter) {
                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)
                goto mlxreg_lc_config_init_fail;
 
-       return err;
+       return 0;
 
 mlxreg_lc_config_init_fail:
 regcache_sync_fail: