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

usb: phy: tegra: switch to using devm_gpiod_get()

I would like to stop exporting OF-specific devm_gpiod_get_from_of_node()
so that gpiolib can be cleaned a bit, so let's switch to the generic
device property API.

I believe that the only reason the driver, instead of the standard
devm_gpiod_get(), used devm_gpiod_get_from_of_node() is because it
wanted to set up a pretty consumer name for the GPIO, and we now have
a special API for that.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-4-b29adfb27a6c@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Torokhov and committed by
Greg Kroah-Hartman
255930b9 d017aeaf

+10 -4
+10 -4
drivers/usb/phy/phy-tegra-usb.c
··· 1440 1440 return err; 1441 1441 } 1442 1442 1443 - gpiod = devm_gpiod_get_from_of_node(&pdev->dev, np, 1444 - "nvidia,phy-reset-gpio", 1445 - 0, GPIOD_OUT_HIGH, 1446 - "ulpi_phy_reset_b"); 1443 + gpiod = devm_gpiod_get(&pdev->dev, "nvidia,phy-reset", 1444 + GPIOD_OUT_HIGH); 1447 1445 err = PTR_ERR_OR_ZERO(gpiod); 1448 1446 if (err) { 1449 1447 dev_err(&pdev->dev, 1450 1448 "Request failed for reset GPIO: %d\n", err); 1451 1449 return err; 1452 1450 } 1451 + 1452 + err = gpiod_set_consumer_name(gpiod, "ulpi_phy_reset_b"); 1453 + if (err) { 1454 + dev_err(&pdev->dev, 1455 + "Failed to set up reset GPIO name: %d\n", err); 1456 + return err; 1457 + } 1458 + 1453 1459 tegra_phy->reset_gpio = gpiod; 1454 1460 1455 1461 phy = devm_otg_ulpi_create(&pdev->dev,