Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fab10cd authored by Axel Lin's avatar Axel Lin Committed by Matthew Garrett
Browse files

panasonic-laptop: fix acpi_pcc_write_sset return value



In current implementation, acpi_pcc_write_sset return 1
if write is successful, 0 if write is failed.
But all the callers consider acpi_pcc_write_sset return 0
if write is successful and return negtive if write is failed.

This patch changes the implementation of acpi_pcc_write_sset to
return 0 if write is successful, -EIO if write is failed.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent bfa47960
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ static int acpi_pcc_write_sset(struct pcc_acpi *pcc, int func, int val)
	status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SSET,
				      &params, NULL);

	return status == AE_OK;
	return (status == AE_OK) ? 0 : -EIO;
}

static inline int acpi_pcc_get_sqty(struct acpi_device *device)
@@ -586,7 +586,6 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc)
static int acpi_pcc_hotkey_resume(struct acpi_device *device)
{
	struct pcc_acpi *pcc = acpi_driver_data(device);
	acpi_status status = AE_OK;

	if (device == NULL || pcc == NULL)
		return -EINVAL;
@@ -594,9 +593,7 @@ static int acpi_pcc_hotkey_resume(struct acpi_device *device)
	ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n",
			  pcc->sticky_mode));

	status = acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode);

	return status == AE_OK ? 0 : -EINVAL;
	return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode);
}

static int acpi_pcc_hotkey_add(struct acpi_device *device)