Skip to content

Commit 38d3cfb

Browse files
Wolfram SangEnric Balletbo i Serra
authored andcommitted
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 <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
1 parent 3b81d8b commit 38d3cfb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/platform/chrome/chromeos_laptop.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -838,18 +838,14 @@ static void chromeos_laptop_destroy(const struct chromeos_laptop *cros_laptop)
838838
i2c_dev = &cros_laptop->i2c_peripherals[i];
839839
info = &i2c_dev->board_info;
840840

841-
if (i2c_dev->client)
842-
i2c_unregister_device(i2c_dev->client);
843-
844-
if (info->properties)
845-
property_entries_free(info->properties);
841+
i2c_unregister_device(i2c_dev->client);
842+
property_entries_free(info->properties);
846843
}
847844

848845
for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) {
849846
acpi_dev = &cros_laptop->acpi_peripherals[i];
850847

851-
if (acpi_dev->properties)
852-
property_entries_free(acpi_dev->properties);
848+
property_entries_free(acpi_dev->properties);
853849
}
854850

855851
kfree(cros_laptop->i2c_peripherals);

0 commit comments

Comments
 (0)