mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/4] fsl/fman: Remove some useless code
Date: Tue, 7 Nov 2017 07:29:21 +0100	[thread overview]
Message-ID: <otrjrq$mee$1@blaine.gmane.org> (raw)
In-Reply-To: <54631ca4ec7d1bdb02f98851adac81fc548240e0.1510003551.git.christophe.jaillet@wanadoo.fr>

Le 06/11/2017 à 22:53, Christophe JAILLET a écrit :
> There is no need to release explicitly some devm_ allocated resources.
> If the 'mac_probe()' probe function fails, they will be released
> automatically, as already done in the other error handling paths of
> this function.
>
> Also goto '_return_of_get_parent' as in the other error handling paths.
> This is useless (priv->fixed_link is NULL at this point), but at least
> it is consistent.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/net/ethernet/freescale/fman/mac.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
> index c27667a005f7..ca12e28129ed 100644
> --- a/drivers/net/ethernet/freescale/fman/mac.c
> +++ b/drivers/net/ethernet/freescale/fman/mac.c
> @@ -709,11 +709,8 @@ static int mac_probe(struct platform_device *_of_dev)
>   	}
>   
>   	if (!of_device_is_available(mac_node)) {
> -		devm_iounmap(dev, priv->vaddr);
> -		__devm_release_region(dev, fman_get_mem_region(priv->fman),
> -				      res.start, res.end + 1 - res.start);
> -		devm_kfree(dev, mac_dev);
> -		return -ENODEV;
> +		err = -ENODEV;
> +		goto _return_of_get_parent;
>   	}
>   
>   	/* Get the cell-index */

Or maybe 'return -EPROBE_DEFER' was expected?

CJ

  reply	other threads:[~2017-11-07  6:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 21:53 [PATCH 0/4] fsl/fman: Fix some error handling code in mac_probe Christophe JAILLET
2017-11-06 21:53 ` [PATCH 1/4] fsl/fman: Remove a useless call to 'dev_set_drvdata()' Christophe JAILLET
2017-11-06 21:53 ` [PATCH 2/4] fsl/fman: Remove some useless code Christophe JAILLET
2017-11-07  6:29   ` Christophe JAILLET [this message]
2017-11-06 21:53 ` [PATCH 3/4] fsl/fman: Add a missing 'of_node_put()' call in an error handling path Christophe JAILLET
2017-11-06 21:53 ` [PATCH 4/4] fsl/fman: Remove a useless 'dev_err()' call Christophe JAILLET
2017-11-07  7:14 ` [PATCH 0/4] fsl/fman: Fix some error handling code in mac_probe Madalin-cristian Bucur
2017-11-08  4:53 ` David Miller

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='otrjrq$mee$1@blaine.gmane.org' \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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®