From: "Arnd Bergmann" <arnd@arndb.de>
To: "Andrew Lunn" <andrew@lunn.ch>, "Arnd Bergmann" <arnd@kernel.org>
Cc: "Wei Fang" <wei.fang@nxp.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
"Shenwei Wang" <shenwei.wang@nxp.com>,
"Clark Wang" <xiaoning.wang@nxp.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
Netdev <netdev@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fec: convert to gpio descriptor
Date: Thu, 26 Jan 2023 21:32:21 +0100 [thread overview]
Message-ID: <b694c12a-e0f7-47af-85c3-eb527963a7aa@app.fastmail.com> (raw)
In-Reply-To: <Y9LAQRjb6h+ynXBZ@lunn.ch>
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
prev parent reply other threads:[~2023-01-26 20:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 13:52 Arnd Bergmann
2023-01-26 18:02 ` Andrew Lunn
2023-01-26 20:32 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b694c12a-e0f7-47af-85c3-eb527963a7aa@app.fastmail.com \
--to=arnd@arndb.de \
--cc=andrew@lunn.ch \
--cc=arnd@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®