[PATCH 16/39] mfd: da9063: don't try to register gpiochip when GPIOLIB isn't built

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes: feee4b638048 (gpio: add DA9062 MFD gpio support)
Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
---
 drivers/mfd/da9063.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/da9063.c b/drivers/mfd/da9063.c
index e1343bac7618..967ca9ac51e4 100644
--- a/drivers/mfd/da9063.c
+++ b/drivers/mfd/da9063.c
@@ -402,13 +402,15 @@ static int da9063_probe(struct device_d *dev)
 
 	restart_handler_register(&priv->restart);
 
-	priv->gpio.base = -1;
-	priv->gpio.ngpio = 5;
-	priv->gpio.ops  = &da9063_gpio_ops;
-	priv->gpio.dev = dev;
-	ret = gpiochip_add(&priv->gpio);
-	if (ret)
-		goto on_error;
+	if (IS_ENABLED(CONFIG_GPIOLIB)) {
+		priv->gpio.base = -1;
+		priv->gpio.ngpio = 5;
+		priv->gpio.ops  = &da9063_gpio_ops;
+		priv->gpio.dev = dev;
+		ret = gpiochip_add(&priv->gpio);
+		if (ret)
+			goto on_error;
+	}
 
 	if (IS_ENABLED(CONFIG_OFDEVICE) && dev->device_node)
 		return of_platform_populate(dev->device_node, NULL, dev);
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux