lkml.org 
[lkml]   [2020]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 10/16] usb: phy: tegra: Use device-tree notion of reset-GPIO's active-state
From
Date
04.01.2020 02:53, Dmitry Osipenko пишет:
> 03.01.2020 10:58, Michał Mirosław пишет:
[snip]
>> [...]
>>> - err = devm_gpio_request(&pdev->dev, tegra_phy->reset_gpio,
>>> - "ulpi_phy_reset_b");
>>> + gpiod = devm_gpiod_get_from_of_node(&pdev->dev, np,
>>> + "nvidia,phy-reset-gpio",
>>> + 0, GPIOD_OUT_HIGH,
>>> + "ulpi_phy_reset_b");
>>> + err = PTR_ERR_OR_ZERO(gpiod);
>>> if (err) {
>>> - dev_err(&pdev->dev, "Request failed for GPIO %d: %d\n",
>>> - tegra_phy->reset_gpio, err);
>>> + dev_err(&pdev->dev,
>>> + "Request failed for reset GPIO: %d\n", err);
>>> return err;
>>> }
>>> + tegra_phy->reset_gpio = gpiod;
>>
>> A nice extension to kernel's printf - "%pe" format - has just landed in
>> Linus' master tree.
>
> Thank you very much, I didn't know about that.

In this particular case PTR_ERR_OR_ZERO() results in a bit more cleaner
code than with IS_ERR() and PTR_ERR() [IMHO], so I'll probably keep it
as-is. Anyways, thanks again for the pointer to "%pe", it could come
handy later on.

\
 
 \ /
  Last update: 2020-01-05 02:00    [W:0.058 / U:0.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site