gpio: Disable functions not used with of-platdata
authorSimon Glass <sjg@chromium.org>
Fri, 5 Feb 2021 04:21:54 +0000 (21:21 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 3 Mar 2021 19:51:06 +0000 (14:51 -0500)
These functions use devicetree and cannot work with of-platdata, which has
no runtime devicetree.

If they are used, the current linker error is confusing, since it talks
about missing functions in the bowels of driver model.

Avoid compiling these functions at all with of-platdata, so that a
straightforward link error points to the problem.

Series-changes; 3
- Fix 'wprl' typo

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
drivers/gpio/gpio-uclass.c

index 4a9b74e..1db5ef0 100644 (file)
@@ -1024,6 +1024,7 @@ err:
        return ret;
 }
 
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
 static int _gpio_request_by_name_nodev(ofnode node, const char *list_name,
                                       int index, struct gpio_desc *desc,
                                       int flags, bool add_index)
@@ -1110,6 +1111,7 @@ int gpio_get_list_count(struct udevice *dev, const char *list_name)
 
        return ret;
 }
+#endif /* OF_PLATDATA */
 
 int dm_gpio_free(struct udevice *dev, struct gpio_desc *desc)
 {