Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751394Ab3ELSin (ORCPT ); Sun, 12 May 2013 14:38:43 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:48138 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957Ab3ELSil (ORCPT ); Sun, 12 May 2013 14:38:41 -0400 Message-ID: <518FE1AD.3090602@cogentembedded.com> Date: Sun, 12 May 2013 22:38:37 +0400 From: Sergei Shtylyov Organization: Cogent Embedded User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Laurent Navet CC: davem@davemloft.net, cernekee@gmail.com, jogo@openwrt.org, joe@perches.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCH] drivers: net: ethernet: broadcom: bcm63xx: use devm_ioremap_resource() References: <1368374165-3228-1-git-send-email-laurent.navet@gmail.com> In-Reply-To: <1368374165-3228-1-git-send-email-laurent.navet@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1446 Lines: 43 Hello. On 05/12/2013 07:56 PM, Laurent Navet wrote: > Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource. > > Found with coccicheck and this semantic patch: > scripts/coccinelle/api/devm_ioremap_resource.cocci > > Signed-off-by: Laurent Navet > --- > drivers/net/ethernet/broadcom/bcm63xx_enet.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c > index 0b3e23e..9de4217 100644 > --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c > +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c > @@ -1641,9 +1641,9 @@ static int bcm_enet_probe(struct platform_device *pdev) > if (ret) > goto out; > > - priv->base = devm_request_and_ioremap(&pdev->dev, res_mem); > - if (priv->base == NULL) { > - ret = -ENOMEM; > + priv->base = devm_ioremap_resource(&pdev->dev, res_mem); > + if (IS_ERR(priv->base)) { > + ret = PTR_ERR(priv->base); > goto out; > } > You may as well delete a check for 'res_mem' being NULL above alloc_etherdev() call since devm_ioremap_resource() checks for that too. WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/