mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 19:21:28 +02:00
net: qrtr: Add ability to override node id from dt
Current VM configurations share the defconfig across VMs. This will cause conflict if multiple VMs are running. Add the ability to set an override node id from device tree. Change-Id: I96c4998e3e3976219724dc938775746e181c9f72 Signed-off-by: Chris Lew <quic_clew@quicinc.com>
This commit is contained in:
parent
81f44092bc
commit
948ff2bd1a
|
|
@ -14,6 +14,7 @@
|
|||
#include <linux/rwsem.h>
|
||||
#include <linux/uidgid.h>
|
||||
#include <linux/pm_wakeup.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/ipc_logging.h>
|
||||
|
||||
#include <net/sock.h>
|
||||
|
|
@ -2086,10 +2087,30 @@ static const struct net_proto_family qrtr_family = {
|
|||
.create = qrtr_create,
|
||||
};
|
||||
|
||||
static void qrtr_update_node_id(void)
|
||||
{
|
||||
const char *compat = "qcom,qrtr";
|
||||
struct device_node *np = NULL;
|
||||
u32 node_id;
|
||||
int ret;
|
||||
|
||||
while ((np = of_find_compatible_node(np, NULL, compat))) {
|
||||
ret = of_property_read_u32(np, "qcom,node-id", &node_id);
|
||||
of_node_put(np);
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
qrtr_local_nid = node_id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int __init qrtr_proto_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
qrtr_update_node_id();
|
||||
|
||||
rc = proto_register(&qrtr_proto, 1);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user