gpiolib: generalize devprop_gpiochip_set_names() for device properties
devprop_gpiochip_set_names() is overly complicated with taking the fwnode argument (which requires using dev_fwnode() & of_fwnode_handle() in ACPI and OF GPIO code respectively). Let's just switch to using the generic device properties. This allows us to pull the code setting line names directly into gpiochip_add_data_with_key() instead of handling it separately for ACPI and OF. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
@@ -340,9 +340,6 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc)
|
||||
struct gpio_device *gdev = gc->gpiodev;
|
||||
int i;
|
||||
|
||||
if (!gc->names)
|
||||
return 0;
|
||||
|
||||
/* First check all names if they are unique */
|
||||
for (i = 0; i != gc->ngpio; ++i) {
|
||||
struct gpio_desc *gpio;
|
||||
@@ -621,7 +618,10 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
|
||||
INIT_LIST_HEAD(&gdev->pin_ranges);
|
||||
#endif
|
||||
|
||||
ret = gpiochip_set_desc_names(gc);
|
||||
if (gc->names)
|
||||
ret = gpiochip_set_desc_names(gc);
|
||||
else
|
||||
ret = devprop_gpiochip_set_names(gc);
|
||||
if (ret)
|
||||
goto err_remove_from_list;
|
||||
|
||||
|
Reference in New Issue
Block a user