From patchwork Wed Feb 12 15:55:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 319660 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 A86E42C008F for ; Thu, 13 Feb 2014 02:59:22 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753155AbaBLP5S (ORCPT ); Wed, 12 Feb 2014 10:57:18 -0500 Received: from mail-ee0-f53.google.com ([74.125.83.53]:37090 "EHLO mail-ee0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112AbaBLP5N (ORCPT ); Wed, 12 Feb 2014 10:57:13 -0500 Received: by mail-ee0-f53.google.com with SMTP id t10so4437230eei.12 for ; Wed, 12 Feb 2014 07:57:11 -0800 (PST) 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:content-type; bh=CHG/7LHQK8AtyteitsPUbJZaJadXPDHnMeJTij1N/oc=; b=NBdJSo8o8VTEP9HQYmHN6vYlAQXULHg+X8wsrhGa1HcmielRZjyjd2HJKSmRZr23zX Y3p+zkdluwtkHSI53zQvvXEkVG5TcudfH95K4SMFYzlTVc8ApIGOn/N96UhF2zFbqadV 7WyPtW4vceUayyN3wHFJ79H1OMb1IdnOCDDzHIi1+O1fGI0T2Nsq0APnG/9+873iTYY4 TTALWclKQI/fs5PAoqG/5DOiCeyiAo+U6LbFrwR5J/l855Xn2uMmSD62gXjdi5GigLU6 wINgq0Mq3mQZ2roJAu4Wb+fT/KSTjZlggXkvi9nod+hG908O9aQL/WeRTTP4L6fcV7vt 8yoA== X-Gm-Message-State: ALoCoQlM0Li6khc91j7K4EzsB4fSFYZW5VS1zlR8UOzJHbRdUZipHrgpKe70B1dr9s8SdvLSeRXr X-Received: by 10.14.180.71 with SMTP id i47mr4850200eem.50.1392220631490; Wed, 12 Feb 2014 07:57:11 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id i43sm82765591eeu.13.2014.02.12.07.57.08 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 12 Feb 2014 07:57:10 -0800 (PST) From: Michal Simek To: netdev@vger.kernel.org Cc: Srikanth Thokala , Srikanth Thokala , Michal Simek , Anirudha Sarangi , John Linn , Grant Likely , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 10/14] net: axienet: Use pdev instead of op Date: Wed, 12 Feb 2014 16:55:44 +0100 Message-Id: <99e22ae9202079e1c71815766a8b3f53ed464a29.1392220536.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: 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 | 49 ++++++++++++----------- 1 file changed, 25 insertions(+), 24 deletions(-) -- 1.8.2.3 diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 4fd8a1d..324033c 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; @@ -1505,9 +1505,9 @@ static int axienet_of_probe(struct platform_device *op) return -ENOMEM; ether_setup(ndev); - 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; @@ -1515,18 +1515,18 @@ 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"); 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,43 +1570,44 @@ 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,temac-type", + p = (__be32 *) of_get_property(pdev->dev.of_node, "xlnx,temac-type", NULL); if (p) lp->temac_type = 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"); 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; } @@ -1615,11 +1616,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) { @@ -1640,9 +1641,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);