Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1326219
| From | Tyrel Datwyler <tyreld@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4/6] ibmvscsi: Use of_root to access OF device tree root node |
| Date | 2016-02-04 00:40 +0100 |
| Message-ID | <qYfbJ-uu-45@gated-at.bofh.it> (permalink) |
| References | <qYf24-oH-53@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
---
drivers/scsi/ibmvscsi/ibmvscsi.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 7e51615..47cfe33 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -248,25 +248,23 @@ static void ibmvscsi_task(void *data)
static void gather_partition_info(void)
{
- struct device_node *rootdn;
-
const char *ppartition_name;
const __be32 *p_number_ptr;
/* Retrieve information about this partition */
- rootdn = of_find_node_by_path("/");
- if (!rootdn) {
+ if (!of_root)
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)
strncpy(partition_name, ppartition_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)
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)
--
2.5.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] ibmvscsi: code cleanup Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:30 +0100
[PATCH 1/6] ibmvscsi: Correct values for several viosrp_crq_format enums Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 1/6] ibmvscsi: Correct values for several viosrp_crq_format enums Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:40 +0100
[PATCH 2/6] ibmvscsi: Add and use enums for valid CRQ header values Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 2/6] ibmvscsi: Add and use enums for valid CRQ header values Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:40 +0100
Re: [PATCH 2/6] ibmvscsi: Add and use enums for valid CRQ header values Manoj Kumar <manoj@linux.vnet.ibm.com> - 2016-02-04 21:00 +0100
Re: [PATCH 2/6] ibmvscsi: Add and use enums for valid CRQ header values Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 22:30 +0100
[PATCH 4/6] ibmvscsi: Use of_root to access OF device tree root node Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 4/6] ibmvscsi: Use of_root to access OF device tree root node Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:50 +0100
[PATCH 6/6] ibmvscsi: Add endian conversions to sysfs attribute show functions Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 6/6] ibmvscsi: Add endian conversions to sysfs attribute show functions Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:50 +0100
[PATCH 3/6] ibmvscsi: Replace magic values in set_adpater_info() with defines Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 3/6] ibmvscsi: Replace magic values in set_adpater_info() with defines Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:50 +0100
csiph-web