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

Configure Feed

Select the types of activity you want to include in your feed.

regulator: tps65090: switch to using devm_fwnode_gpiod_get

devm_gpiod_get_from_of_node() is being retired in favor of
devm_fwnode_gpiod_get_index(), that behaves similar to
devm_gpiod_get_index(), but can work with arbitrary firmware node. It
will also be able to support secondary software nodes.

Let's switch this driver over.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20191004231017.130290-4-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dmitry Torokhov and committed by
Mark Brown
51d98ff8 de2cd1a5

+15 -11
+15 -11
drivers/regulator/tps65090-regulator.c
··· 346 346 for (idx = 0; idx < ARRAY_SIZE(tps65090_matches); idx++) { 347 347 struct regulator_init_data *ri_data; 348 348 struct tps65090_regulator_plat_data *rpdata; 349 + struct device_node *np; 349 350 350 351 rpdata = &reg_pdata[idx]; 351 352 ri_data = tps65090_matches[idx].init_data; 352 - if (!ri_data || !tps65090_matches[idx].of_node) 353 + if (!ri_data) 354 + continue; 355 + 356 + np = tps65090_matches[idx].of_node; 357 + if (!np) 353 358 continue; 354 359 355 360 rpdata->reg_init_data = ri_data; 356 - rpdata->enable_ext_control = of_property_read_bool( 357 - tps65090_matches[idx].of_node, 358 - "ti,enable-ext-control"); 361 + rpdata->enable_ext_control = of_property_read_bool(np, 362 + "ti,enable-ext-control"); 359 363 if (rpdata->enable_ext_control) { 360 364 enum gpiod_flags gflags; 361 365 ··· 370 366 gflags = GPIOD_OUT_LOW; 371 367 gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE; 372 368 373 - rpdata->gpiod = devm_gpiod_get_from_of_node(&pdev->dev, 374 - tps65090_matches[idx].of_node, 375 - "dcdc-ext-control-gpios", 0, 376 - gflags, 377 - "tps65090"); 369 + rpdata->gpiod = devm_fwnode_gpiod_get( 370 + &pdev->dev, 371 + of_fwnode_handle(np), 372 + "dcdc-ext-control", 373 + gflags, 374 + "tps65090"); 378 375 if (PTR_ERR(rpdata->gpiod) == -ENOENT) { 379 376 dev_err(&pdev->dev, 380 377 "could not find DCDC external control GPIO\n"); ··· 384 379 return ERR_CAST(rpdata->gpiod); 385 380 } 386 381 387 - if (of_property_read_u32(tps65090_matches[idx].of_node, 388 - "ti,overcurrent-wait", 382 + if (of_property_read_u32(np, "ti,overcurrent-wait", 389 383 &rpdata->overcurrent_wait) == 0) 390 384 rpdata->overcurrent_wait_valid = true; 391 385