From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754585AbdKGG3b (ORCPT ); Tue, 7 Nov 2017 01:29:31 -0500 Received: from [195.159.176.226] ([195.159.176.226]:33207 "EHLO blaine.gmane.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754523AbdKGG3a (ORCPT ); Tue, 7 Nov 2017 01:29:30 -0500 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Christophe JAILLET Subject: Re: [PATCH 2/4] fsl/fman: Remove some useless code Date: Tue, 7 Nov 2017 07:29:21 +0100 Message-ID: References: <54631ca4ec7d1bdb02f98851adac81fc548240e0.1510003551.git.christophe.jaillet@wanadoo.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 In-Reply-To: <54631ca4ec7d1bdb02f98851adac81fc548240e0.1510003551.git.christophe.jaillet@wanadoo.fr> Content-Language: fr Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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