From patchwork Tue May 5 09:26:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 467981 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DC877140777 for ; Tue, 5 May 2015 19:28:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031582AbbEEJ2p (ORCPT ); Tue, 5 May 2015 05:28:45 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:34986 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031444AbbEEJ0b (ORCPT ); Tue, 5 May 2015 05:26:31 -0400 Received: by widdi4 with SMTP id di4so152348045wid.0 for ; Tue, 05 May 2015 02:26:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=Yd68chpL3voHK2Fqxbb9buLt5xR9bleAb7tSEcpmyOE=; b=PAEtmkY5VIk2bnokyr/D4bpcqFjaGtYpa9MrFxBoHTU1Khq+n/daOq+2TVisuuna2U nN2Y1LZVlJ+A5NHT9MrTZDfHJBu60zgnFEPOUTXCLGGqYtnOVLMTlc7151YTsh2fwMNP GEYXBbnjpJinwfWuDvWBJ5dHpW4fNCsgel7K4XDBbb8yC2R6Oun7Uytt8BP5ktywre/W +DKTeZD/5fzB54hlsymD0doPRhVftdlCwQq0eTBsXDVn1Y9q734hTa5YbdkzVSz03Bi0 ot0KSmetF7hLxXZlQ3WcHOtjJkZwK6dfKSodSo6SBwVCRLR71OSw9ZO6d+5aKSUJvva5 eOJg== X-Gm-Message-State: ALoCoQlLLQIHUFqggwPFeWjwiffWXaezFH/LwHelHa0yCKkGzMgIx1qDrKUabBTexip5E+/96k+r X-Received: by 10.194.21.8 with SMTP id r8mr22293684wje.60.1430817990059; Tue, 05 May 2015 02:26:30 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by mx.google.com with ESMTPSA id w5sm15180508wiz.11.2015.05.05.02.26.28 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Tue, 05 May 2015 02:26:29 -0700 (PDT) From: Michal Simek To: netdev@vger.kernel.org Cc: Srikanth Thokala , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , monstr@monstr.eu, John Linn , Anirudha Sarangi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/12] net: axienet: Use pdev instead of op Date: Tue, 5 May 2015 11:26:01 +0200 Message-Id: X-Mailer: git-send-email 2.3.5 In-Reply-To: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> References: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> In-Reply-To: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> References: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Srikanth Thokala Synchronize names with other drivers Signed-off-by: Srikanth Thokala Signed-off-by: Michal Simek --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 47 ++++++++++++----------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index ddaa07a0bf51..757b2dc30cef 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1480,7 +1480,7 @@ static void axienet_dma_err_handler(unsigned long data) /** * axienet_of_probe - Axi Ethernet probe function. - * @op: Pointer to platform device structure. + * @pdev: Pointer to platform device structure. * @match: Pointer to device id structure * * returns: 0, on success @@ -1491,7 +1491,7 @@ static void axienet_dma_err_handler(unsigned long data) * device. Parses through device tree and populates fields of * axienet_local. It registers the Ethernet device. */ -static int axienet_of_probe(struct platform_device *op) +static int axienet_of_probe(struct platform_device *pdev) { __be32 *p; int size, ret = 0; @@ -1504,9 +1504,9 @@ static int axienet_of_probe(struct platform_device *op) if (!ndev) return -ENOMEM; - platform_set_drvdata(op, ndev); + platform_set_drvdata(pdev, ndev); - SET_NETDEV_DEV(ndev, &op->dev); + SET_NETDEV_DEV(ndev, &pdev->dev); ndev->flags &= ~IFF_MULTICAST; /* clear multicast */ ndev->features = NETIF_F_SG; ndev->netdev_ops = &axienet_netdev_ops; @@ -1514,19 +1514,19 @@ static int axienet_of_probe(struct platform_device *op) lp = netdev_priv(ndev); lp->ndev = ndev; - lp->dev = &op->dev; + lp->dev = &pdev->dev; lp->options = XAE_OPTION_DEFAULTS; /* Map device registers */ - lp->regs = of_iomap(op->dev.of_node, 0); + lp->regs = of_iomap(pdev->dev.of_node, 0); if (!lp->regs) { - dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); + dev_err(&pdev->dev, "could not map Axi Ethernet regs.\n"); ret = -ENOMEM; goto nodev; } /* Setup checksum offload, but default to off if not specified */ lp->features = 0; - p = (__be32 *) of_get_property(op->dev.of_node, "xlnx,txcsum", NULL); + p = (__be32 *)of_get_property(pdev->dev.of_node, "xlnx,txcsum", NULL); if (p) { switch (be32_to_cpup(p)) { case 1: @@ -1547,7 +1547,7 @@ static int axienet_of_probe(struct platform_device *op) lp->csum_offload_on_tx_path = XAE_NO_CSUM_OFFLOAD; } } - p = (__be32 *) of_get_property(op->dev.of_node, "xlnx,rxcsum", NULL); + p = (__be32 *)of_get_property(pdev->dev.of_node, "xlnx,rxcsum", NULL); if (p) { switch (be32_to_cpup(p)) { case 1: @@ -1570,40 +1570,41 @@ static int axienet_of_probe(struct platform_device *op) * Here we check for memory allocated for Rx/Tx in the hardware from * the device-tree and accordingly set flags. */ - p = (__be32 *) of_get_property(op->dev.of_node, "xlnx,rxmem", NULL); + p = (__be32 *)of_get_property(pdev->dev.of_node, "xlnx,rxmem", NULL); if (p) lp->rxmem = be32_to_cpup(p); - p = (__be32 *) of_get_property(op->dev.of_node, "xlnx,phy-type", NULL); + p = (__be32 *)of_get_property(pdev->dev.of_node, + "xlnx,phy-type", NULL); if (p) lp->phy_type = be32_to_cpup(p); /* Find the DMA node, map the DMA registers, and decode the DMA IRQs */ - np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); + np = of_parse_phandle(pdev->dev.of_node, "axistream-connected", 0); if (!np) { - dev_err(&op->dev, "could not find DMA node\n"); + dev_err(&pdev->dev, "could not find DMA node\n"); ret = -ENODEV; goto err_iounmap; } lp->dma_regs = of_iomap(np, 0); if (lp->dma_regs) { - dev_dbg(&op->dev, "MEM base: %p\n", lp->dma_regs); + dev_dbg(&pdev->dev, "MEM base: %p\n", lp->dma_regs); } else { - dev_err(&op->dev, "unable to map DMA registers\n"); + dev_err(&pdev->dev, "unable to map DMA registers\n"); of_node_put(np); } lp->rx_irq = irq_of_parse_and_map(np, 1); lp->tx_irq = irq_of_parse_and_map(np, 0); of_node_put(np); if ((lp->rx_irq <= 0) || (lp->tx_irq <= 0)) { - dev_err(&op->dev, "could not determine irqs\n"); + dev_err(&pdev->dev, "could not determine irqs\n"); ret = -ENOMEM; goto err_iounmap_2; } /* Retrieve the MAC address */ - addr = of_get_property(op->dev.of_node, "local-mac-address", &size); + addr = of_get_property(pdev->dev.of_node, "local-mac-address", &size); if ((!addr) || (size != 6)) { - dev_err(&op->dev, "could not find MAC address\n"); + dev_err(&pdev->dev, "could not find MAC address\n"); ret = -ENODEV; goto err_iounmap_2; } @@ -1612,11 +1613,11 @@ static int axienet_of_probe(struct platform_device *op) lp->coalesce_count_rx = XAXIDMA_DFT_RX_THRESHOLD; lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD; - lp->phy_node = of_parse_phandle(op->dev.of_node, "phy-handle", 0); + lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); if (lp->phy_node) - ret = axienet_mdio_setup(lp, op->dev.of_node); + ret = axienet_mdio_setup(lp, pdev->dev.of_node); if (ret) - dev_warn(&op->dev, "error registering MDIO bus\n"); + dev_warn(&pdev->dev, "error registering MDIO bus\n"); ret = register_netdev(lp->ndev); if (ret) { @@ -1637,9 +1638,9 @@ nodev: return ret; } -static int axienet_of_remove(struct platform_device *op) +static int axienet_of_remove(struct platform_device *pdev) { - struct net_device *ndev = platform_get_drvdata(op); + struct net_device *ndev = platform_get_drvdata(pdev); struct axienet_local *lp = netdev_priv(ndev); axienet_mdio_teardown(lp);