devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
To: Santosh Shilimkar <santosh.shilimkar-l0cyMroinI0@public.gmane.org>
Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	sandeep_n-l0cyMroinI0@public.gmane.org
Subject: Re: [PATCH v4 2/3] net: Add Keystone NetCP ethernet driver
Date: Thu, 25 Sep 2014 07:29:23 -0700	[thread overview]
Message-ID: <1411655363.4026.13.camel@joe-AO725> (raw)
In-Reply-To: <1411653805-29257-3-git-send-email-santosh.shilimkar-l0cyMroinI0@public.gmane.org>

On Thu, 2014-09-25 at 10:03 -0400, Santosh Shilimkar wrote:
> From: Sandeep Nair <sandeep_n-l0cyMroinI0@public.gmane.org>
> 
> The network coprocessor (NetCP) is a hardware accelerator that processes
> Ethernet packets. NetCP has a gigabit Ethernet (GbE) subsystem with a ethernet
> switch sub-module to send and receive packets. NetCP also includes a packet
> accelerator (PA) module to perform packet classification operations such as
> header matching, and packet modification operations such as checksum
> generation. NetCP can also optionally include a Security Accelerator(SA)
> capable of performing IPSec operations on ingress/egress packets.

Some checkpatch trivia you might consider:
---
 drivers/net/ethernet/ti/netcp_ethss.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index 4b273a2..8443bf3 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -253,6 +253,7 @@ struct xgbe_hw_stats {
 	u32	rx_mof_overruns;
 	u32	rx_dma_overruns;
 };
+
 #define XGBE10_NUM_STAT_ENTRIES (sizeof(struct xgbe_hw_stats)/sizeof(u32))
 
 struct gbe_ss_regs {
@@ -264,12 +265,12 @@ struct gbe_ss_regs {
 	u32	rx_en;
 	u32	tx_en;
 	u32	misc_en;
-	u32	mem_allign1[8];
+	u32	mem_align1[8];
 	u32	rx_thresh_stat;
 	u32	rx_stat;
 	u32	tx_stat;
 	u32	misc_stat;
-	u32	mem_allign2[8];
+	u32	mem_align2[8];
 	u32	rx_imax;
 	u32	tx_imax;
 };
@@ -398,6 +399,7 @@ struct gbe_hw_stats {
 	u32	rx_mof_overruns;
 	u32	rx_dma_overruns;
 };
+
 #define GBE13_NUM_HW_STAT_ENTRIES (sizeof(struct gbe_hw_stats)/sizeof(u32))
 #define GBE13_NUM_HW_STATS_MOD			2
 #define XGBE10_NUM_HW_STATS_MOD			3
@@ -1188,7 +1190,6 @@ static void gbe_slave_stop(struct gbe_intf *intf)
 	cpsw_ale_del_mcast(gbe_dev->ale, intf->ndev->broadcast,
 			   1 << slave->port_num, 0, 0);
 
-
 	if (!slave->phy)
 		return;
 
@@ -1253,12 +1254,11 @@ static int gbe_slave_open(struct gbe_intf *gbe_intf)
 			dev_err(priv->dev, "phy not found on slave %d\n",
 				slave->slave_num);
 			return -ENODEV;
-		} else {
-			dev_dbg(priv->dev, "phy found: id is: 0x%s\n",
-				dev_name(&slave->phy->dev));
-			phy_start(slave->phy);
-			phy_read_status(slave->phy);
 		}
+		dev_dbg(priv->dev, "phy found: id is: 0x%s\n",
+			dev_name(&slave->phy->dev));
+		phy_start(slave->phy);
+		phy_read_status(slave->phy);
 	}
 	return 0;
 }
@@ -1501,7 +1501,6 @@ static int gbe_open(void *intf_priv, struct net_device *ndev)
 	else
 		gbe_intf->tx_pipe.dma_psflags = port_num;
 
-
 	dev_dbg(gbe_dev->dev, "opened TX channel %s: %p with psflags %d\n",
 		gbe_intf->tx_pipe.dma_chan_name,
 		gbe_intf->tx_pipe.dma_channel,
@@ -1557,7 +1556,7 @@ static int init_slave(struct gbe_priv *gbe_dev, struct gbe_slave *slave,
 	u32 port_reg_ofs, emac_reg_ofs;
 
 	if (of_property_read_u32(node, "slave-port", &slave->slave_num)) {
-		dev_err(gbe_dev->dev, "missing slave-port paramater\n");
+		dev_err(gbe_dev->dev, "missing slave-port parameter\n");
 		return -EINVAL;
 	}
 
@@ -1906,10 +1905,8 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
 	}
 
 	gbe_dev = devm_kzalloc(dev, sizeof(struct gbe_priv), GFP_KERNEL);
-	if (!gbe_dev) {
-		dev_err(dev, "gbe_dev memory allocation failed\n");
+	if (!gbe_dev)
 		return -ENOMEM;
-	}
 
 	gbe_dev->dev = dev;
 	gbe_dev->netcp_device = netcp_device;
@@ -2053,10 +2050,9 @@ static int gbe_attach(void *inst_priv, struct net_device *ndev,
 	}
 
 	gbe_intf = devm_kzalloc(gbe_dev->dev, sizeof(*gbe_intf), GFP_KERNEL);
-	if (!gbe_intf) {
-		dev_err(gbe_dev->dev, "gbe interface memory allocation failed\n");
+	if (!gbe_intf)
 		return -ENOMEM;
-	}
+
 	gbe_intf->ndev = ndev;
 	gbe_intf->dev = gbe_dev->dev;
 	gbe_intf->gbe_dev = gbe_dev;
@@ -2065,7 +2061,6 @@ static int gbe_attach(void *inst_priv, struct net_device *ndev,
 					sizeof(*gbe_intf->slave),
 					GFP_KERNEL);
 	if (!gbe_intf->slave) {
-		dev_err(gbe_dev->dev, "gbe interface slave memory allocation failed\n");
 		ret = -ENOMEM;
 		goto fail;
 	}


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-09-25 14:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25 14:03 [PATCH v4 0/3] net: Add Keystone NetCP ethernet driver support Santosh Shilimkar
2014-09-25 14:03 ` [PATCH v4 1/3] Documentation: dt: net: Add binding doc for Keystone NetCP ethernet driver Santosh Shilimkar
2014-09-25 14:03 ` [PATCH v4 2/3] net: Add " Santosh Shilimkar
     [not found]   ` <1411653805-29257-3-git-send-email-santosh.shilimkar-l0cyMroinI0@public.gmane.org>
2014-09-25 14:29     ` Joe Perches [this message]
2014-09-25 17:06       ` Santosh Shilimkar
2014-09-25 14:03 ` [PATCH v4 3/3] MAINTAINER: net: Add TI NETCP Ethernet driver entry Santosh Shilimkar

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=1411655363.4026.13.camel@joe-AO725 \
    --to=joe-6d6dil74uinbdgjk7y7tuq@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sandeep_n-l0cyMroinI0@public.gmane.org \
    --cc=santosh.shilimkar-l0cyMroinI0@public.gmane.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;
as well as URLs for NNTP newsgroup(s).