From: Rafael J. Wysocki <[email protected]>
Because acpi_walk_dep_device_list() is only called by the code in the
file in which it is defined, make it static, drop the export of it
and drop its header from acpi.h.
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/acpi/scan.c | 7 +++----
include/linux/acpi.h | 3 ---
2 files changed, 3 insertions(+), 7 deletions(-)
Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -2145,9 +2145,9 @@ static int acpi_scan_clear_dep(struct ac
* negative value is returned by the callback then the loop is broken and that
* value is returned as the final error.
*/
-int acpi_walk_dep_device_list(acpi_handle handle,
- int (*callback)(struct acpi_dep_data *, void *),
- void *data)
+static int acpi_walk_dep_device_list(acpi_handle handle,
+ int (*callback)(struct acpi_dep_data *, void *),
+ void *data)
{
struct acpi_dep_data *dep, *tmp;
int ret = 0;
@@ -2164,7 +2164,6 @@ int acpi_walk_dep_device_list(acpi_handl
return ret > 0 ? 0 : ret;
}
-EXPORT_SYMBOL_GPL(acpi_walk_dep_device_list);
/**
* acpi_dev_clear_dependencies - Inform consumers that the device is now active
Index: linux-pm/include/linux/acpi.h
===================================================================
--- linux-pm.orig/include/linux/acpi.h
+++ linux-pm/include/linux/acpi.h
@@ -668,9 +668,6 @@ extern bool acpi_driver_match_device(str
const struct device_driver *drv);
int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
int acpi_device_modalias(struct device *, char *, int);
-int acpi_walk_dep_device_list(acpi_handle handle,
- int (*callback)(struct acpi_dep_data *, void *),
- void *data);
struct platform_device *acpi_create_platform_device(struct acpi_device *,
struct property_entry *);
Hi,
On 6/16/21 4:22 PM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <[email protected]>
>
> Because acpi_walk_dep_device_list() is only called by the code in the
> file in which it is defined, make it static, drop the export of it
> and drop its header from acpi.h.
>
> Signed-off-by: Rafael J. Wysocki <[email protected]>
Actually, acpi_walk_dep_device_list() was split out as a
helper function used to implement acpi_dev_clear_dependencies()
because it will be used outside of drivers/acpi.
Specifically it will be used in the new intel_skl_int3472 driver:
https://patchwork.kernel.org/project/platform-driver-x86/patch/[email protected]/
Which I plan to merge into pdx86/for-next today, I've just merged
your linux-pm/acpi-scan PULL-req which exports acpi_walk_dep_device_list()
as preparation for this.
Regards,
Hans
> ---
> drivers/acpi/scan.c | 7 +++----
> include/linux/acpi.h | 3 ---
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> Index: linux-pm/drivers/acpi/scan.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/scan.c
> +++ linux-pm/drivers/acpi/scan.c
> @@ -2145,9 +2145,9 @@ static int acpi_scan_clear_dep(struct ac
> * negative value is returned by the callback then the loop is broken and that
> * value is returned as the final error.
> */
> -int acpi_walk_dep_device_list(acpi_handle handle,
> - int (*callback)(struct acpi_dep_data *, void *),
> - void *data)
> +static int acpi_walk_dep_device_list(acpi_handle handle,
> + int (*callback)(struct acpi_dep_data *, void *),
> + void *data)
> {
> struct acpi_dep_data *dep, *tmp;
> int ret = 0;
> @@ -2164,7 +2164,6 @@ int acpi_walk_dep_device_list(acpi_handl
>
> return ret > 0 ? 0 : ret;
> }
> -EXPORT_SYMBOL_GPL(acpi_walk_dep_device_list);
>
> /**
> * acpi_dev_clear_dependencies - Inform consumers that the device is now active
> Index: linux-pm/include/linux/acpi.h
> ===================================================================
> --- linux-pm.orig/include/linux/acpi.h
> +++ linux-pm/include/linux/acpi.h
> @@ -668,9 +668,6 @@ extern bool acpi_driver_match_device(str
> const struct device_driver *drv);
> int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
> int acpi_device_modalias(struct device *, char *, int);
> -int acpi_walk_dep_device_list(acpi_handle handle,
> - int (*callback)(struct acpi_dep_data *, void *),
> - void *data);
>
> struct platform_device *acpi_create_platform_device(struct acpi_device *,
> struct property_entry *);
>
>
>
On Wed, Jun 16, 2021 at 4:41 PM Hans de Goede <[email protected]> wrote:
>
> Hi,
>
> On 6/16/21 4:22 PM, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <[email protected]>
> >
> > Because acpi_walk_dep_device_list() is only called by the code in the
> > file in which it is defined, make it static, drop the export of it
> > and drop its header from acpi.h.
> >
> > Signed-off-by: Rafael J. Wysocki <[email protected]>
>
> Actually, acpi_walk_dep_device_list() was split out as a
> helper function used to implement acpi_dev_clear_dependencies()
> because it will be used outside of drivers/acpi.
Not exactly.
> Specifically it will be used in the new intel_skl_int3472 driver:
> https://patchwork.kernel.org/project/platform-driver-x86/patch/[email protected]/
That driver will use acpi_dev_get_first_consumer_dev() which is based
on acpi_walk_dep_device_list(), but still defined in
drivers/acpi/scan.c.
> Which I plan to merge into pdx86/for-next today, I've just merged
> your linux-pm/acpi-scan PULL-req which exports acpi_walk_dep_device_list()
> as preparation for this.
No, the acpi_walk_dep_device_list() is a leftover there AFAICS.
If it needs to be exported in the future, that still can be done. ATM
the export isn't necessary.
Thanks!
On Wed, Jun 16, 2021 at 5:11 PM Rafael J. Wysocki <[email protected]> wrote:
>
> On Wed, Jun 16, 2021 at 4:41 PM Hans de Goede <[email protected]> wrote:
> >
> > Hi,
> >
> > On 6/16/21 4:22 PM, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <[email protected]>
> > >
> > > Because acpi_walk_dep_device_list() is only called by the code in the
> > > file in which it is defined, make it static, drop the export of it
> > > and drop its header from acpi.h.
> > >
> > > Signed-off-by: Rafael J. Wysocki <[email protected]>
> >
> > Actually, acpi_walk_dep_device_list() was split out as a
> > helper function used to implement acpi_dev_clear_dependencies()
> > because it will be used outside of drivers/acpi.
>
> Not exactly.
>
> > Specifically it will be used in the new intel_skl_int3472 driver:
> > https://patchwork.kernel.org/project/platform-driver-x86/patch/[email protected]/
>
> That driver will use acpi_dev_get_first_consumer_dev() which is based
> on acpi_walk_dep_device_list(), but still defined in
> drivers/acpi/scan.c.
>
> > Which I plan to merge into pdx86/for-next today, I've just merged
> > your linux-pm/acpi-scan PULL-req which exports acpi_walk_dep_device_list()
> > as preparation for this.
>
> No, the acpi_walk_dep_device_list() is a leftover there AFAICS.
I mean the export of it.
> If it needs to be exported in the future, that still can be done. ATM
> the export isn't necessary.
>
> Thanks!
Hi,
On 6/16/21 5:11 PM, Rafael J. Wysocki wrote:
> On Wed, Jun 16, 2021 at 4:41 PM Hans de Goede <[email protected]> wrote:
>>
>> Hi,
>>
>> On 6/16/21 4:22 PM, Rafael J. Wysocki wrote:
>>> From: Rafael J. Wysocki <[email protected]>
>>>
>>> Because acpi_walk_dep_device_list() is only called by the code in the
>>> file in which it is defined, make it static, drop the export of it
>>> and drop its header from acpi.h.
>>>
>>> Signed-off-by: Rafael J. Wysocki <[email protected]>
>>
>> Actually, acpi_walk_dep_device_list() was split out as a
>> helper function used to implement acpi_dev_clear_dependencies()
>> because it will be used outside of drivers/acpi.
>
> Not exactly.
>
>> Specifically it will be used in the new intel_skl_int3472 driver:
>> https://patchwork.kernel.org/project/platform-driver-x86/patch/[email protected]/
>
> That driver will use acpi_dev_get_first_consumer_dev() which is based
> on acpi_walk_dep_device_list(), but still defined in
> drivers/acpi/scan.c.
>
>> Which I plan to merge into pdx86/for-next today, I've just merged
>> your linux-pm/acpi-scan PULL-req which exports acpi_walk_dep_device_list()
>> as preparation for this.
>
> No, the acpi_walk_dep_device_list() is a leftover there AFAICS.
You are right, my bad.
So with this resolved, this patch is fine too:
Reviewed-by: Hans de Goede <[email protected]>
Regards,
Hans