diff mbox

core/init: Use '_' as separator in names of "exports" properties

Message ID 1491276139-19539-1-git-send-email-mpe@ellerman.id.au
State Accepted
Headers show

Commit Message

Michael Ellerman April 4, 2017, 3:22 a.m. UTC
The names of the properties under /ibm,opal/firmware/exports are used
directly by Linux to create files in sysfs. To remain consistent with
the existing naming of OPAL sysfs files, use '_' as the separator.

In particular for the symbol map which is already exported separately,
it's cleaner for the two files to have the same name, eg:

  /sys/firmware/opal/exports/symbol_map
  /sys/firmware/opal/symbol_map

Fixes: 9ffbfe269ec6 ("core/init: Add hdat-map property to OPAL node")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 core/opal.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Stewart Smith April 5, 2017, 8 a.m. UTC | #1
Michael Ellerman <mpe@ellerman.id.au> writes:
> The names of the properties under /ibm,opal/firmware/exports are used
> directly by Linux to create files in sysfs. To remain consistent with
> the existing naming of OPAL sysfs files, use '_' as the separator.
>
> In particular for the symbol map which is already exported separately,
> it's cleaner for the two files to have the same name, eg:
>
>   /sys/firmware/opal/exports/symbol_map
>   /sys/firmware/opal/symbol_map
>
> Fixes: 9ffbfe269ec6 ("core/init: Add hdat-map property to OPAL node")
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Thanks, merged to master as of 036d2e8d4f90e7828177f37ce330768370b0e845
diff mbox

Patch

diff --git a/core/opal.c b/core/opal.c
index 7bc403c2e552..73223b1fe200 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -135,8 +135,13 @@  static void add_opal_firmware_exports_node(struct dt_node *node)
 	uint64_t sym_start = (uint64_t)__sym_map_start;
 	uint64_t sym_size = (uint64_t)__sym_map_end - sym_start;
 
-	dt_add_property_u64s(exports, "symbol-map", sym_start, sym_size);
-	dt_add_property_u64s(exports, "hdat-map", SPIRA_HEAP_BASE,
+	/*
+	 * These property names will be used by Linux as the user-visible file
+	 * name, so make them meaningful if possible. We use _ as the separator
+	 * here to remain consistent with existing file names in /sys/opal.
+	 */
+	dt_add_property_u64s(exports, "symbol_map", sym_start, sym_size);
+	dt_add_property_u64s(exports, "hdat_map", SPIRA_HEAP_BASE,
 				SPIRA_HEAP_SIZE);
 }