|
@@ -301,7 +301,7 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * gpiochip_add() - register a gpio_chip
|
|
|
+ * gpiochip_add_data() - register a gpio_chip
|
|
|
* @chip: the chip to register, with chip->base initialized
|
|
|
* Context: potentially before irqs will work
|
|
|
*
|
|
@@ -309,7 +309,7 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc)
|
|
|
* because the chip->base is invalid or already associated with a
|
|
|
* different chip. Otherwise it returns zero as a success code.
|
|
|
*
|
|
|
- * When gpiochip_add() is called very early during boot, so that GPIOs
|
|
|
+ * When gpiochip_add_data() is called very early during boot, so that GPIOs
|
|
|
* can be freely used, the chip->parent device must be registered before
|
|
|
* the gpio framework's arch_initcall(). Otherwise sysfs initialization
|
|
|
* for GPIOs will fail rudely.
|
|
@@ -317,7 +317,7 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc)
|
|
|
* If chip->base is negative, this requests dynamic assignment of
|
|
|
* a range of valid GPIOs.
|
|
|
*/
|
|
|
-int gpiochip_add(struct gpio_chip *chip)
|
|
|
+int gpiochip_add_data(struct gpio_chip *chip, void *data)
|
|
|
{
|
|
|
unsigned long flags;
|
|
|
int status = 0;
|
|
@@ -329,6 +329,8 @@ int gpiochip_add(struct gpio_chip *chip)
|
|
|
if (!descs)
|
|
|
return -ENOMEM;
|
|
|
|
|
|
+ chip->data = data;
|
|
|
+
|
|
|
if (chip->ngpio == 0) {
|
|
|
chip_err(chip, "tried to insert a GPIO chip with zero lines\n");
|
|
|
return -EINVAL;
|
|
@@ -415,7 +417,7 @@ err_free_descs:
|
|
|
chip->label ? : "generic");
|
|
|
return status;
|
|
|
}
|
|
|
-EXPORT_SYMBOL_GPL(gpiochip_add);
|
|
|
+EXPORT_SYMBOL_GPL(gpiochip_add_data);
|
|
|
|
|
|
/**
|
|
|
* gpiochip_remove() - unregister a gpio_chip
|