platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity
authorVadim Pasternak <vadimp@nvidia.com>
Tue, 19 Jul 2022 15:35:40 +0000 (18:35 +0300)
committerHans de Goede <hdegoede@redhat.com>
Thu, 28 Jul 2022 18:38:08 +0000 (20:38 +0200)
commitb4b830a34d8046633231b7fe87f6f2cb6240dc9f
tree9e66b829fe8e92c3fd7cf7627318ba61da814f03
parentc9d959fc32a5f9312282817052d8986614f2dc08
platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity

Fix error flow:
- Clean-up client object in case of probing failure.
- Prevent running remove routine in case of probing failure.
  Probing and removing are invoked by hotplug events raised upon line
  card insertion and removing. If probing procedure failed all data is
  cleared and there is nothing to do in remove routine.

Fixes: 62f9529b8d5c ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20220719153540.61304-1-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