lkml.org 
[lkml]   [2023]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fec: convert to gpio descriptor
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

\
 
 \ /
  Last update: 2023-03-26 23:57    [W:0.042 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site