提交 2454f8d1 编写于 作者: M Markus Pargmann 提交者: Mark Brown

regulator: gpio: Use gpio_is_valid

Use gpio_is_valid instead of an explicit comparison with 0.
Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 5315fe2f
...@@ -322,7 +322,7 @@ static int gpio_regulator_probe(struct platform_device *pdev) ...@@ -322,7 +322,7 @@ static int gpio_regulator_probe(struct platform_device *pdev)
cfg.driver_data = drvdata; cfg.driver_data = drvdata;
cfg.of_node = np; 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 = config->enable_gpio;
cfg.ena_gpio_initialized = true; cfg.ena_gpio_initialized = true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册