diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2019-08-20 17:34:49 +0200 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2019-08-26 15:15:52 +0200 |
commit | 38d3cfbc95624fa2e8e84cd36c10bfef31d90f0c (patch) | |
tree | 315dbad9626feb399e5188829a38fb881b5c5a23 /drivers/platform | |
parent | 3b81d8bdd9143449a85166e7987aedea145fce54 (diff) | |
download | linux-38d3cfbc95624fa2e8e84cd36c10bfef31d90f0c.tar.bz2 |
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/chrome/chromeos_laptop.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c index 7abbb6167766..8723bcf10c93 100644 --- a/drivers/platform/chrome/chromeos_laptop.c +++ b/drivers/platform/chrome/chromeos_laptop.c @@ -838,18 +838,14 @@ static void chromeos_laptop_destroy(const struct chromeos_laptop *cros_laptop) i2c_dev = &cros_laptop->i2c_peripherals[i]; info = &i2c_dev->board_info; - if (i2c_dev->client) - i2c_unregister_device(i2c_dev->client); - - if (info->properties) - property_entries_free(info->properties); + i2c_unregister_device(i2c_dev->client); + property_entries_free(info->properties); } for (i = 0; i < cros_laptop->num_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); |