提交 5114d6a7 编写于 作者: T Tyrel Datwyler 提交者: Martin K. Petersen

ibmvscsi: Use of_root to access OF device tree root node

The root node of the OF device tree is exported as of_root. No need to
look up the root by path name. Instead just get a reference directly via
of_root.
Signed-off-by: NTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 45d8c30f
...@@ -248,25 +248,23 @@ static void ibmvscsi_task(void *data) ...@@ -248,25 +248,23 @@ static void ibmvscsi_task(void *data)
static void gather_partition_info(void) static void gather_partition_info(void)
{ {
struct device_node *rootdn;
const char *ppartition_name; const char *ppartition_name;
const __be32 *p_number_ptr; const __be32 *p_number_ptr;
/* Retrieve information about this partition */ /* Retrieve information about this partition */
rootdn = of_find_node_by_path("/"); if (!of_root)
if (!rootdn) {
return; return;
}
ppartition_name = of_get_property(rootdn, "ibm,partition-name", NULL); of_node_get(of_root);
ppartition_name = of_get_property(of_root, "ibm,partition-name", NULL);
if (ppartition_name) if (ppartition_name)
strncpy(partition_name, ppartition_name, strncpy(partition_name, ppartition_name,
sizeof(partition_name)); sizeof(partition_name));
p_number_ptr = of_get_property(rootdn, "ibm,partition-no", NULL); p_number_ptr = of_get_property(of_root, "ibm,partition-no", NULL);
if (p_number_ptr) if (p_number_ptr)
partition_number = of_read_number(p_number_ptr, 1); partition_number = of_read_number(p_number_ptr, 1);
of_node_put(rootdn); of_node_put(of_root);
} }
static void set_adapter_info(struct ibmvscsi_host_data *hostdata) static void set_adapter_info(struct ibmvscsi_host_data *hostdata)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册