Thread (24 messages) 24 messages, 3 authors, 2018-03-29

Re: [net-next,v2,01/10] soc: ti: K2G: enhancement to support QMSS in NSS

From: Murali Karicheri <hidden>
Date: 2018-03-29 14:57:24
Also in: linux-arm-kernel, linux-devicetree, lkml

On 03/28/2018 03:01 PM, Grygorii Strashko wrote:
Hi Murali,
quoted
  
+enum qmss_version {
+	QMSS,
+	QMSS_LITE,
QMSS_66AK2G
OK.
quoted
+};
+
  struct knav_device {
  	struct device				*dev;
  	unsigned				base_id;
@@ -305,6 +310,7 @@ struct knav_device {
  	struct list_head			pools;
  	struct list_head			pdsps;
  	struct list_head			qmgrs;
+	enum qmss_version			version;
  };
  
[...]
quoted
  }
  
+/* Match table for of_platform binding */
+static const struct of_device_id keystone_qmss_of_match[] = {
+	{
+		.compatible = "ti,keystone-navigator-qmss",
		.data	= (void *)QMSS,
This seems to be unnecessary as QMSS is actually defined as zero. Also 
this static. So that value is zero already in memory.
quoted
+	},
+	{
+		.compatible = "ti,keystone-navigator-qmss-l",
+		.data	= (void *)QMSS_LITE,
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, keystone_qmss_of_match);
+
  static int knav_queue_probe(struct platform_device *pdev)
  {
  	struct device_node *node = pdev->dev.of_node;
  	struct device_node *qmgrs, *queue_pools, *regions, *pdsps;
+	const struct of_device_id *match;
  	struct device *dev = &pdev->dev;
  	u32 temp[2];
  	int ret;
@@ -1700,6 +1749,10 @@ static int knav_queue_probe(struct platform_device *pdev)
  		return -ENOMEM;
  	}
  
+	match = of_match_device(of_match_ptr(keystone_qmss_of_match), dev);
+	if (match && match->data)
+		kdev->version = QMSS_LITE;
	if (match)
		kdev->version = match->data;
	else
		error?
Similar to above. This private memory is allocated using kzalloc which initializes
everything to zero. So the else part is unnecessary.

Murali
[...]

-- 
Murali Karicheri
Linux Kernel, Keystone
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help