[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c783be58-b983-45ab-b0ff-7deb38ee70b5@intel.com>
Date: Wed, 28 Aug 2024 15:11:33 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Yang Ruibin <11162571@...o.com>, Lino Sanfilippo <LinoSanfilippo@....de>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <opensource.kernel@...o.com>
Subject: Re: [PATCH v1] net: alacritech: Switch to use dev_err_probe()
nit: subject should include "net-next" for changes like this which are
cleanups meant for the net-next tree.
On 8/28/2024 5:26 AM, Yang Ruibin wrote:x
> use dev_err_probe() instead of dev_err() to simplify the error path and
> standardize the format of the error code.
>
> Signed-off-by: Yang Ruibin <11162571@...o.com>
> ---
> drivers/net/ethernet/alacritech/slicoss.c | 34 ++++++++++-------------
> 1 file changed, 14 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/ethernet/alacritech/slicoss.c b/drivers/net/ethernet/alacritech/slicoss.c
> index 78231c852..65919ace0 100644
> --- a/drivers/net/ethernet/alacritech/slicoss.c
> +++ b/drivers/net/ethernet/alacritech/slicoss.c
> @@ -1051,11 +1051,9 @@ static int slic_load_rcvseq_firmware(struct slic_device *sdev)
> file = (sdev->model == SLIC_MODEL_OASIS) ? SLIC_RCV_FIRMWARE_OASIS :
> SLIC_RCV_FIRMWARE_MOJAVE;
> err = request_firmware(&fw, file, &sdev->pdev->dev);
> - if (err) {
> - dev_err(&sdev->pdev->dev,
> + if (err)
> + return dev_err_probe(&sdev->pdev->dev, err,
> "failed to load receive sequencer firmware %s\n", file);
Nice. dev_err_probe also handles some specific behavior for
-EPROBE_DEFER, which isn't being used here. That's fine since the custom
logic only triggers specifically on -EPROBE_DEFER. It also has custom
handling to avoid logging an error message on -ENOMEM. Neat.
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Powered by blists - more mailing lists