diff mbox series

[3/3] pinctrl: cherryview: Use the new acpi_evaluate_reg() helper

Message ID 20200505132128.19476-4-hdegoede@redhat.com
State New
Headers show
Series ACPI / utils: Add acpi_evaluate_reg() helper | expand

Commit Message

Hans de Goede May 5, 2020, 1:21 p.m. UTC
Use the new acpi_evaluate_reg() helper in the pinctrl-cherryview code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/pinctrl/intel/pinctrl-cherryview.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Andy Shevchenko May 5, 2020, 3:44 p.m. UTC | #1
On Tue, May 05, 2020 at 03:21:28PM +0200, Hans de Goede wrote:
> Use the new acpi_evaluate_reg() helper in the pinctrl-cherryview code.

Will wait for Mika's Ack.

> +	acpi_evaluate_reg(adev->handle, ACPI_ADR_SPACE_GPIO,
> +			  ACPI_REG_CONNECT);

I believe it perfectly one line (perhaps description in kernel doc as well in patch 1).
diff mbox series

Patch

diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index 4817aec114d6..579bdfcfab8f 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -1693,8 +1693,6 @@  static acpi_status chv_pinctrl_mmio_access_handler(u32 function,
 
 static int chv_pinctrl_probe(struct platform_device *pdev)
 {
-	struct acpi_object_list input;
-	union acpi_object params[2];
 	struct chv_pinctrl *pctrl;
 	struct acpi_device *adev;
 	acpi_status status;
@@ -1765,13 +1763,8 @@  static int chv_pinctrl_probe(struct platform_device *pdev)
 	 * the GeneralPurposeIo OpRegion. Manually call _REG here so that
 	 * the DSDT-s GeneralPurposeIo availability checks will succeed.
 	 */
-	params[0].type = ACPI_TYPE_INTEGER;
-	params[0].integer.value = ACPI_ADR_SPACE_GPIO;
-	params[1].type = ACPI_TYPE_INTEGER;
-	params[1].integer.value = 1;
-	input.count = 2;
-	input.pointer = params;
-	acpi_evaluate_object(adev->handle, "_REG", &input, NULL);
+	acpi_evaluate_reg(adev->handle, ACPI_ADR_SPACE_GPIO,
+			  ACPI_REG_CONNECT);
 
 	platform_set_drvdata(pdev, pctrl);