Commit ed7adc2b authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Hans de Goede

platform/x86: serial-multi-instantiate: Use while (i--) pattern to clean up

Use more natural while (i--) patter to clean up allocated resources.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220709211653.18938-4-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 14a9aa99
...@@ -70,11 +70,11 @@ static int smi_get_irq(struct platform_device *pdev, struct acpi_device *adev, ...@@ -70,11 +70,11 @@ static int smi_get_irq(struct platform_device *pdev, struct acpi_device *adev,
static void smi_devs_unregister(struct smi *smi) static void smi_devs_unregister(struct smi *smi)
{ {
while (smi->i2c_num > 0) while (smi->i2c_num--)
i2c_unregister_device(smi->i2c_devs[--smi->i2c_num]); i2c_unregister_device(smi->i2c_devs[smi->i2c_num]);
while (smi->spi_num > 0) while (smi->spi_num--)
spi_unregister_device(smi->spi_devs[--smi->spi_num]); spi_unregister_device(smi->spi_devs[smi->spi_num]);
} }
/** /**
......
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