diff mbox series

[v2,2/2] ACPI / hotplug / PCI: Use the new acpi_evaluate_reg() helper

Message ID 20200507104917.116589-2-hdegoede@redhat.com (mailing list archive)
State Not Applicable, archived
Headers show
Series [v2,1/2] ACPI / utils: Add acpi_evaluate_reg() helper | expand

Commit Message

Hans de Goede May 7, 2020, 10:49 a.m. UTC
Use the new acpi_evaluate_reg() helper in the acpiphp_glue.c code.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- Leave comment about not caring about _REG errors in place
- Add Bjorn's Acked-by
- Add Andy's Reviewed-by
---
 drivers/pci/hotplug/acpiphp_glue.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Comments

Rafael J. Wysocki May 9, 2020, 9:41 a.m. UTC | #1
On Thursday, May 7, 2020 12:49:17 PM CEST Hans de Goede wrote:
> Use the new acpi_evaluate_reg() helper in the acpiphp_glue.c code.
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> - Leave comment about not caring about _REG errors in place
> - Add Bjorn's Acked-by
> - Add Andy's Reviewed-by
> ---
>  drivers/pci/hotplug/acpiphp_glue.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index b3869951c0eb..b4c92cee13f8 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -385,19 +385,12 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  static void acpiphp_set_acpi_region(struct acpiphp_slot *slot)
>  {
>  	struct acpiphp_func *func;
> -	union acpi_object params[2];
> -	struct acpi_object_list arg_list;
>  
>  	list_for_each_entry(func, &slot->funcs, sibling) {
> -		arg_list.count = 2;
> -		arg_list.pointer = params;
> -		params[0].type = ACPI_TYPE_INTEGER;
> -		params[0].integer.value = ACPI_ADR_SPACE_PCI_CONFIG;
> -		params[1].type = ACPI_TYPE_INTEGER;
> -		params[1].integer.value = 1;
>  		/* _REG is optional, we don't care about if there is failure */
> -		acpi_evaluate_object(func_to_handle(func), "_REG", &arg_list,
> -				     NULL);
> +		acpi_evaluate_reg(func_to_handle(func),
> +				  ACPI_ADR_SPACE_PCI_CONFIG,
> +				  ACPI_REG_CONNECT);
>  	}
>  }
>  
> 

Applied as 5.8 material along with the [1/2], thanks!
diff mbox series

Patch

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index b3869951c0eb..b4c92cee13f8 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -385,19 +385,12 @@  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 static void acpiphp_set_acpi_region(struct acpiphp_slot *slot)
 {
 	struct acpiphp_func *func;
-	union acpi_object params[2];
-	struct acpi_object_list arg_list;
 
 	list_for_each_entry(func, &slot->funcs, sibling) {
-		arg_list.count = 2;
-		arg_list.pointer = params;
-		params[0].type = ACPI_TYPE_INTEGER;
-		params[0].integer.value = ACPI_ADR_SPACE_PCI_CONFIG;
-		params[1].type = ACPI_TYPE_INTEGER;
-		params[1].integer.value = 1;
 		/* _REG is optional, we don't care about if there is failure */
-		acpi_evaluate_object(func_to_handle(func), "_REG", &arg_list,
-				     NULL);
+		acpi_evaluate_reg(func_to_handle(func),
+				  ACPI_ADR_SPACE_PCI_CONFIG,
+				  ACPI_REG_CONNECT);
 	}
 }