diff --git a/drivers/gpio/gpiolib-swnode.c b/drivers/gpio/gpiolib-swnode.c index 8d9591aa9304..304994c5c7d0 100644 --- a/drivers/gpio/gpiolib-swnode.c +++ b/drivers/gpio/gpiolib-swnode.c @@ -26,7 +26,6 @@ static struct gpio_device *swnode_get_gpio_device(struct fwnode_handle *fwnode) { const struct software_node *gdev_node; - struct gpio_device *gdev; gdev_node = to_software_node(fwnode); if (!gdev_node) @@ -41,27 +40,7 @@ static struct gpio_device *swnode_get_gpio_device(struct fwnode_handle *fwnode) return ERR_PTR(-ENOENT); fwnode_lookup: - gdev = gpio_device_find_by_fwnode(fwnode); - if (!gdev && gdev_node && gdev_node->name) - /* - * FIXME: We shouldn't need to compare the GPIO controller's - * label against the software node that is supposedly attached - * to it. However there are currently GPIO users that - knowing - * the expected label of the GPIO chip whose pins they want to - * control - set up dummy software nodes named after those GPIO - * controllers, which aren't actually attached to them. In this - * case gpio_device_find_by_fwnode() will fail as no device on - * the GPIO bus is actually associated with the fwnode we're - * looking for. - * - * As a fallback: continue checking the label if we have no - * match. However, the situation described above is an abuse - * of the software node API and should be phased out and the - * following line - eventually removed. - */ - gdev = gpio_device_find_by_label(gdev_node->name); - - return gdev ?: ERR_PTR(-EPROBE_DEFER); + return gpio_device_find_by_fwnode(fwnode) ?: ERR_PTR(-EPROBE_DEFER); } static int swnode_gpio_get_reference(const struct fwnode_handle *fwnode,