platform/chrome: chromeos_laptop: drop checks of NULL-safe functions
No need to check the argument of i2c_unregister_device() and property_entries_free() because the functions do check it. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
This commit is contained in:

committed by
Enric Balletbo i Serra

parent
3b81d8bdd9
commit
38d3cfbc95
@@ -838,18 +838,14 @@ static void chromeos_laptop_destroy(const struct chromeos_laptop *cros_laptop)
|
|||||||
i2c_dev = &cros_laptop->i2c_peripherals[i];
|
i2c_dev = &cros_laptop->i2c_peripherals[i];
|
||||||
info = &i2c_dev->board_info;
|
info = &i2c_dev->board_info;
|
||||||
|
|
||||||
if (i2c_dev->client)
|
i2c_unregister_device(i2c_dev->client);
|
||||||
i2c_unregister_device(i2c_dev->client);
|
property_entries_free(info->properties);
|
||||||
|
|
||||||
if (info->properties)
|
|
||||||
property_entries_free(info->properties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) {
|
for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) {
|
||||||
acpi_dev = &cros_laptop->acpi_peripherals[i];
|
acpi_dev = &cros_laptop->acpi_peripherals[i];
|
||||||
|
|
||||||
if (acpi_dev->properties)
|
property_entries_free(acpi_dev->properties);
|
||||||
property_entries_free(acpi_dev->properties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(cros_laptop->i2c_peripherals);
|
kfree(cros_laptop->i2c_peripherals);
|
||||||
|
Reference in New Issue
Block a user