Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Vadim Pasternak and committed by
Hans de Goede
1c8ee06b 52e01c0b

+4 -5
+4 -5
drivers/platform/mellanox/mlxreg-lc.c
··· 825 825 826 826 mutex_init(&mlxreg_lc->lock); 827 827 /* Set event notification callback. */ 828 - if (data->notifier) { 829 - data->notifier->user_handler = mlxreg_lc_event_handler; 830 - data->notifier->handle = mlxreg_lc; 831 - } 828 + data->notifier->user_handler = mlxreg_lc_event_handler; 829 + data->notifier->handle = mlxreg_lc; 830 + 832 831 data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr); 833 832 if (!data->hpdev.adapter) { 834 833 dev_err(&pdev->dev, "Failed to get adapter for bus %d\n", ··· 887 888 if (err) 888 889 goto mlxreg_lc_config_init_fail; 889 890 890 - return err; 891 + return 0; 891 892 892 893 mlxreg_lc_config_init_fail: 893 894 regcache_sync_fail: