Skip to content

Commit 4b09479

Browse files
Boris BrezillonLinus Walleij
authored andcommitted
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 <[email protected]> Acked-by: Jacek Anaszewski <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent b2987d7 commit 4b09479

File tree

6 files changed

+37
-33
lines changed

6 files changed

+37
-33
lines changed

drivers/gpio/devres.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
123123
EXPORT_SYMBOL(devm_gpiod_get_index);
124124

125125
/**
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
127128
* @dev: GPIO consumer
128129
* @con_id: function within the GPIO consumer
129130
* @child: firmware node (child of @dev)
@@ -135,11 +136,11 @@ EXPORT_SYMBOL(devm_gpiod_get_index);
135136
* On successfull request the GPIO pin is configured in accordance with
136137
* provided @flags.
137138
*/
138-
struct gpio_desc *devm_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)
139+
struct gpio_desc *devm_fwnode_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)
143144
{
144145
static const char * const suffixes[] = { "gpios", "gpio" };
145146
char prop_name[32]; /* 32 is max size of property name */
@@ -174,7 +175,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
174175

175176
return desc;
176177
}
177-
EXPORT_SYMBOL(devm_get_gpiod_from_child);
178+
EXPORT_SYMBOL(devm_fwnode_get_gpiod_from_child);
178179

179180
/**
180181
* devm_gpiod_get_index_optional - Resource-managed gpiod_get_index_optional()

drivers/input/keyboard/gpio_keys.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,10 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
481481
spin_lock_init(&bdata->lock);
482482

483483
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);
486488
if (IS_ERR(bdata->gpiod)) {
487489
error = PTR_ERR(bdata->gpiod);
488490
if (error == -ENOENT) {

drivers/input/keyboard/gpio_keys_polled.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
303303
return -EINVAL;
304304
}
305305

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);
310310
if (IS_ERR(bdata->gpiod)) {
311311
error = PTR_ERR(bdata->gpiod);
312312
if (error != -EPROBE_DEFER)

drivers/leds/leds-gpio.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
182182
return ERR_PTR(-EINVAL);
183183
}
184184

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);
187188
if (IS_ERR(led.gpiod)) {
188189
fwnode_handle_put(child);
189190
return ERR_CAST(led.gpiod);

drivers/video/fbdev/amba-clcd-nomadik.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,26 +185,26 @@ static void tpg110_init(struct device *dev, struct device_node *np,
185185
dev_info(dev, "TPG110 display init\n");
186186

187187
/* 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");
190190
if (IS_ERR(grestb)) {
191191
dev_err(dev, "no GRESTB GPIO\n");
192192
return;
193193
}
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");
196196
if (IS_ERR(scen)) {
197197
dev_err(dev, "no SCEN GPIO\n");
198198
return;
199199
}
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");
202202
if (IS_ERR(scl)) {
203203
dev_err(dev, "no SCL GPIO\n");
204204
return;
205205
}
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");
208208
if (IS_ERR(sda)) {
209209
dev_err(dev, "no SDA GPIO\n");
210210
return;

include/linux/gpio/consumer.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
138138
const char *propname,
139139
enum gpiod_flags dflags,
140140
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);
146146
#else /* CONFIG_GPIOLIB */
147147

148148
static inline int gpiod_count(struct device *dev, const char *con_id)
@@ -425,11 +425,11 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
425425
}
426426

427427
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)
433433
{
434434
return ERR_PTR(-ENOSYS);
435435
}

0 commit comments

Comments
 (0)