Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: Rename devm_get_gpiod_from_child()

Rename devm_get_gpiod_from_child() into
devm_fwnode_get_gpiod_from_child() to reflect the fact that this
function is operating on a fwnode object.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Boris Brezillon and committed by
Linus Walleij
4b094797 b2987d74

+37 -33
+8 -7
drivers/gpio/devres.c
··· 123 123 EXPORT_SYMBOL(devm_gpiod_get_index); 124 124 125 125 /** 126 - * devm_get_gpiod_from_child - get a GPIO descriptor from a device's child node 126 + * devm_fwnode_get_gpiod_from_child - get a GPIO descriptor from a device's 127 + * child node 127 128 * @dev: GPIO consumer 128 129 * @con_id: function within the GPIO consumer 129 130 * @child: firmware node (child of @dev) ··· 136 135 * On successfull request the GPIO pin is configured in accordance with 137 136 * provided @flags. 138 137 */ 139 - struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, 140 - const char *con_id, 141 - struct fwnode_handle *child, 142 - enum gpiod_flags flags, 143 - const char *label) 138 + struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, 139 + const char *con_id, 140 + struct fwnode_handle *child, 141 + enum gpiod_flags flags, 142 + const char *label) 144 143 { 145 144 static const char * const suffixes[] = { "gpios", "gpio" }; 146 145 char prop_name[32]; /* 32 is max size of property name */ ··· 175 174 176 175 return desc; 177 176 } 178 - EXPORT_SYMBOL(devm_get_gpiod_from_child); 177 + EXPORT_SYMBOL(devm_fwnode_get_gpiod_from_child); 179 178 180 179 /** 181 180 * devm_gpiod_get_index_optional - Resource-managed gpiod_get_index_optional()
+4 -2
drivers/input/keyboard/gpio_keys.c
··· 481 481 spin_lock_init(&bdata->lock); 482 482 483 483 if (child) { 484 - bdata->gpiod = devm_get_gpiod_from_child(dev, NULL, child, 485 - GPIOD_IN, desc); 484 + bdata->gpiod = devm_fwnode_get_gpiod_from_child(dev, NULL, 485 + child, 486 + GPIOD_IN, 487 + desc); 486 488 if (IS_ERR(bdata->gpiod)) { 487 489 error = PTR_ERR(bdata->gpiod); 488 490 if (error == -ENOENT) {
+4 -4
drivers/input/keyboard/gpio_keys_polled.c
··· 303 303 return -EINVAL; 304 304 } 305 305 306 - bdata->gpiod = devm_get_gpiod_from_child(dev, NULL, 307 - child, 308 - GPIOD_IN, 309 - button->desc); 306 + bdata->gpiod = devm_fwnode_get_gpiod_from_child(dev, 307 + NULL, child, 308 + GPIOD_IN, 309 + button->desc); 310 310 if (IS_ERR(bdata->gpiod)) { 311 311 error = PTR_ERR(bdata->gpiod); 312 312 if (error != -EPROBE_DEFER)
+3 -2
drivers/leds/leds-gpio.c
··· 182 182 return ERR_PTR(-EINVAL); 183 183 } 184 184 185 - led.gpiod = devm_get_gpiod_from_child(dev, NULL, child, 186 - GPIOD_ASIS, led.name); 185 + led.gpiod = devm_fwnode_get_gpiod_from_child(dev, NULL, child, 186 + GPIOD_ASIS, 187 + led.name); 187 188 if (IS_ERR(led.gpiod)) { 188 189 fwnode_handle_put(child); 189 190 return ERR_CAST(led.gpiod);
+8 -8
drivers/video/fbdev/amba-clcd-nomadik.c
··· 185 185 dev_info(dev, "TPG110 display init\n"); 186 186 187 187 /* This asserts the GRESTB signal, putting the display into reset */ 188 - grestb = devm_get_gpiod_from_child(dev, "grestb", &np->fwnode, 189 - GPIOD_OUT_HIGH, "grestb"); 188 + grestb = devm_fwnode_get_gpiod_from_child(dev, "grestb", &np->fwnode, 189 + GPIOD_OUT_HIGH, "grestb"); 190 190 if (IS_ERR(grestb)) { 191 191 dev_err(dev, "no GRESTB GPIO\n"); 192 192 return; 193 193 } 194 - scen = devm_get_gpiod_from_child(dev, "scen", &np->fwnode, 195 - GPIOD_OUT_LOW, "scen"); 194 + scen = devm_fwnode_get_gpiod_from_child(dev, "scen", &np->fwnode, 195 + GPIOD_OUT_LOW, "scen"); 196 196 if (IS_ERR(scen)) { 197 197 dev_err(dev, "no SCEN GPIO\n"); 198 198 return; 199 199 } 200 - scl = devm_get_gpiod_from_child(dev, "scl", &np->fwnode, GPIOD_OUT_LOW, 201 - "scl"); 200 + scl = devm_fwnode_get_gpiod_from_child(dev, "scl", &np->fwnode, 201 + GPIOD_OUT_LOW, "scl"); 202 202 if (IS_ERR(scl)) { 203 203 dev_err(dev, "no SCL GPIO\n"); 204 204 return; 205 205 } 206 - sda = devm_get_gpiod_from_child(dev, "sda", &np->fwnode, GPIOD_OUT_LOW, 207 - "sda"); 206 + sda = devm_fwnode_get_gpiod_from_child(dev, "sda", &np->fwnode, 207 + GPIOD_OUT_LOW, "sda"); 208 208 if (IS_ERR(sda)) { 209 209 dev_err(dev, "no SDA GPIO\n"); 210 210 return;
+10 -10
include/linux/gpio/consumer.h
··· 138 138 const char *propname, 139 139 enum gpiod_flags dflags, 140 140 const char *label); 141 - struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, 142 - const char *con_id, 143 - struct fwnode_handle *child, 144 - enum gpiod_flags flags, 145 - const char *label); 141 + struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, 142 + const char *con_id, 143 + struct fwnode_handle *child, 144 + enum gpiod_flags flags, 145 + const char *label); 146 146 #else /* CONFIG_GPIOLIB */ 147 147 148 148 static inline int gpiod_count(struct device *dev, const char *con_id) ··· 425 425 } 426 426 427 427 static inline 428 - struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, 429 - const char *con_id, 430 - struct fwnode_handle *child, 431 - enum gpiod_flags flags, 432 - const char *label) 428 + struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, 429 + const char *con_id, 430 + struct fwnode_handle *child, 431 + enum gpiod_flags flags, 432 + const char *label) 433 433 { 434 434 return ERR_PTR(-ENOSYS); 435 435 }