Re: [PATCH v3 10/16] usb: phy: tegra: Use device-tree notion of reset-GPIO's active-state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux