Re: [PATCH] fec: convert to gpio descriptor

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

 



On Thu, Jan 26, 2023, at 19:02, Andrew Lunn wrote:
> On Thu, Jan 26, 2023 at 02:52:58PM +0100, Arnd Bergmann wrote:
>>  static int fec_reset_phy(struct platform_device *pdev)
>>  {
>> -	int err, phy_reset;
>> +	int err;
>> +	struct gpio_desc *phy_reset;
>>  	bool active_high = false;
>>  	int msec = 1, phy_post_delay = 0;
>>  	struct device_node *np = pdev->dev.of_node;
>
> Hi Arnd
>
> netdev drivers are supposed to use 'reverse Christmas tree'. It looks
> like this function is actually using 'Christmas tree' :-) Please could
> you keep with the current coding style.

My feeling is that the style in this file is just random,
but having 'err' as the last one fits with the usual style
and with what some of the other functions do, so I'll do that.

>> +			active_high ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
>> +	if (IS_ERR(phy_reset)) {
>> +		err = PTR_ERR(phy_reset);
>> +		if (err != -EPROBE_DEFER)
>> +			dev_err(&pdev->dev,
>> +				"failed to get phy-reset-gpios: %d\n", err);
>
> dev_err_probe() looks usable here.

Ah nice, I've never been able to use that one so far.

Will send a v2 with both suggestions.

    ARnd



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux