[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9fd12e5f-00c0-0292-b8a1-3fad48bfc4a3@gmail.com>
Date: Sun, 5 Jan 2020 03:58:39 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc: Rob Herring <robh+dt@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Peter Chen <Peter.Chen@....com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Felipe Balbi <balbi@...nel.org>, devicetree@...r.kernel.org,
linux-usb@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 10/16] usb: phy: tegra: Use device-tree notion of
reset-GPIO's active-state
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.
Powered by blists - more mailing lists