Skip to contentSkip to conversation

ACPI / property: Export a couple of symbols.

PATCH In review David Daney 3 participants 6 messages Mar 17, 2016 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / property: Export a couple of symbols.

From: David Daney <[email protected]>

The acpi_dev_prop_read() and acpi_dev_prop_read_single() can be called by drivers. Add EXPORT_SYMBOL_GPL to them to allow use by modular drivers. This makes them consistent with acpi_dev_get_property() and acpi_node_get_property_reference() which are already exported.

---
FWIW: We hope to submit soon Cavium Thunder networking patches that fail under modular builds without these exports.

 drivers/acpi/property.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/property.c +2 -0
index 2aee416..de225dc 100644
@@ -638,6 +638,7 @@ int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname,
 {
 	return adev ? acpi_data_prop_read_single(&adev->data, propname, proptype, val) : -EINVAL;
 }
+EXPORT_SYMBOL_GPL(acpi_dev_prop_read_single);
 
 static int acpi_copy_property_array_u8(const union acpi_object *items, u8 *val,
 				       size_t nval)
@@ -772,6 +773,7 @@ int acpi_dev_prop_read(struct acpi_device *adev, const char *propname,
 {
 	return adev ? acpi_data_prop_read(&adev->data, propname, proptype, val, nval) : -EINVAL;
 }
+EXPORT_SYMBOL_GPL(acpi_dev_prop_read);
 
 /**
  * acpi_node_prop_read - retrieve the value of an ACPI property with given name.
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 4 lines · David Daney

From: David Daney <[email protected]>

The acpi_dev_prop_read() and acpi_dev_prop_read_single() can be called by drivers.

May I see the driver code that uses them?

Thanks,
Rafael

#2 lore raw
In reply to David Daney
Quoted 11 lines · David Daney

From: David Daney <[email protected]>

The acpi_dev_prop_read() and acpi_dev_prop_read_single() can be called by drivers. Add EXPORT_SYMBOL_GPL to them to allow use by modular drivers. This makes them consistent with acpi_dev_get_property() and acpi_node_get_property_reference() which are already exported.

---
FWIW: We hope to submit soon Cavium Thunder networking patches that fail under modular builds without these exports.

You should not be using these functions directly in drivers.

#3 lore raw
Quoted 8 lines · Mika Westerberg
Quoted 7 lines · David Daney

From: David Daney <[email protected]>

The acpi_dev_prop_read() and acpi_dev_prop_read_single() can be called by drivers. Add EXPORT_SYMBOL_GPL to them to allow use by modular drivers. This makes them consistent with acpi_dev_get_property() and acpi_node_get_property_reference() which are already exported.

Quoted 6 lines
Quoted 4 lines

---
FWIW: We hope to submit soon Cavium Thunder networking patches that fail under modular builds without these exports.

You should not be using these functions directly in drivers.

That's exactly my point.

#4 lore raw
Quoted 10 lines · Rafael J. Wysocki
Quoted 8 lines · Mika Westerberg
Quoted 7 lines · David Daney

From: David Daney <[email protected]>

The acpi_dev_prop_read() and acpi_dev_prop_read_single() can be called by drivers. Add EXPORT_SYMBOL_GPL to them to allow use by modular drivers. This makes them consistent with acpi_dev_get_property() and acpi_node_get_property_reference() which are already exported.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

---
FWIW: We hope to submit soon Cavium Thunder networking patches that fail under modular builds without these exports.

You should not be using these functions directly in drivers.

That's exactly my point.

OK, for the sake of argument I will concede that my particular use of acpi_dev_prop_read_single() is incorrect.

Let me ask you this:

What is the point of the code in drivers/acpi/property.c?

acpi_dev_prop_read() and acpi_dev_prop_read_single() are not used anywhere that I can see in the kernel, would you accept a patch to remove them?

But from a philosophical point of view, what is the underlying problem of having drivers extract property information from the ACPI tables corresponding to the devices they control.

Specifically, I am trying to understand how to port drivers that currently successfully use OF device tree so that they are usable in systems with ACPI based firmware.

Thanks in advance,
David Daney

#5 lore raw
Quoted 26 lines · David Daney
Quoted 19 lines · Rafael J. Wysocki
Quoted 16 lines · Mika Westerberg
Quoted 12 lines · David Daney

From: David Daney <[email protected]>

The acpi_dev_prop_read() and acpi_dev_prop_read_single() can be called by drivers. Add EXPORT_SYMBOL_GPL to them to allow use by modular drivers. This makes them consistent with acpi_dev_get_property() and acpi_node_get_property_reference() which are already exported.

---
FWIW: We hope to submit soon Cavium Thunder networking patches that fail under modular builds without these exports.

Quoted 5 lines
Quoted 1 line

You should not be using these functions directly in drivers.

That's exactly my point.

Quoted 6 lines

OK, for the sake of argument I will concede that my particular use of acpi_dev_prop_read_single() is incorrect.

Let me ask you this:

What is the point of the code in drivers/acpi/property.c?

It is used by the code in drivers/base/property.c.

Quoted 2 lines

acpi_dev_prop_read() and acpi_dev_prop_read_single() are not used anywhere that I can see in the kernel, would you accept a patch to remove them?

Yes, I would. They are leftovers.

Quoted 7 lines

But from a philosophical point of view, what is the underlying problem of having drivers extract property information from the ACPI tables corresponding to the devices they control.

Specifically, I am trying to understand how to port drivers that currently successfully use OF device tree so that they are usable in systems with ACPI based firmware.

The code in drivers/base/property.c is for that in theory. If it doesn't work for you, please let me know what the problem is.

Thanks,
Rafael