mirror of https://gitee.com/openkylin/linux.git
regulator: gpio: Use gpio_is_valid
Use gpio_is_valid instead of an explicit comparison with 0. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
5315fe2f8d
commit
2454f8d15c
|
@ -322,7 +322,7 @@ static int gpio_regulator_probe(struct platform_device *pdev)
|
|||
cfg.driver_data = drvdata;
|
||||
cfg.of_node = np;
|
||||
|
||||
if (config->enable_gpio >= 0) {
|
||||
if (gpio_is_valid(config->enable_gpio)) {
|
||||
cfg.ena_gpio = config->enable_gpio;
|
||||
cfg.ena_gpio_initialized = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue