From 17979bdfb75833f519801ebf9cf4e54c26d128ee Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Tue, 25 Jan 2022 15:12:13 -0600 Subject: [PATCH] drivers: regulator: pmic: remove unneeded NULL check Remove unneeded NULL check in pmic init function. Not required as device_is_ready() will handle NULL device structs. Signed-off-by: Daniel DeGrasse --- drivers/regulator/regulator_pmic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/regulator_pmic.c b/drivers/regulator/regulator_pmic.c index f70d582050d..6aa1f6e0145 100644 --- a/drivers/regulator/regulator_pmic.c +++ b/drivers/regulator/regulator_pmic.c @@ -301,7 +301,7 @@ static int pmic_reg_init(const struct device *dev) /* Do the same cast for current limit ranges */ data->current_levels = (struct current_range *)config->current_array; /* Check to verify we have a valid I2C device */ - if (config->i2c_dev == NULL || !device_is_ready(config->i2c_dev)) { + if (!device_is_ready(config->i2c_dev)) { return -ENODEV; } return 0;