mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 00:08:50 +00:00
platform/x86/amd/pmf: Return a status code only as a constant in two functions
Return a status code without storing it in an intermediate variable. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Link: https://lore.kernel.org/r/0d0c4876-37d7-4bee-912e-56324495454f@web.de Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
9dd3f1ef40
commit
4527898e30
@ -111,7 +111,6 @@ int apmf_os_power_slider_update(struct amd_pmf_dev *pdev, u8 event)
|
|||||||
struct os_power_slider args;
|
struct os_power_slider args;
|
||||||
struct acpi_buffer params;
|
struct acpi_buffer params;
|
||||||
union acpi_object *info;
|
union acpi_object *info;
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
args.size = sizeof(args);
|
args.size = sizeof(args);
|
||||||
args.slider_event = event;
|
args.slider_event = event;
|
||||||
@ -121,10 +120,10 @@ int apmf_os_power_slider_update(struct amd_pmf_dev *pdev, u8 event)
|
|||||||
|
|
||||||
info = apmf_if_call(pdev, APMF_FUNC_OS_POWER_SLIDER_UPDATE, ¶ms);
|
info = apmf_if_call(pdev, APMF_FUNC_OS_POWER_SLIDER_UPDATE, ¶ms);
|
||||||
if (!info)
|
if (!info)
|
||||||
err = -EIO;
|
return -EIO;
|
||||||
|
|
||||||
kfree(info);
|
kfree(info);
|
||||||
return err;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void apmf_sbios_heartbeat_notify(struct work_struct *work)
|
static void apmf_sbios_heartbeat_notify(struct work_struct *work)
|
||||||
@ -146,7 +145,6 @@ int apmf_update_fan_idx(struct amd_pmf_dev *pdev, bool manual, u32 idx)
|
|||||||
union acpi_object *info;
|
union acpi_object *info;
|
||||||
struct apmf_fan_idx args;
|
struct apmf_fan_idx args;
|
||||||
struct acpi_buffer params;
|
struct acpi_buffer params;
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
args.size = sizeof(args);
|
args.size = sizeof(args);
|
||||||
args.fan_ctl_mode = manual;
|
args.fan_ctl_mode = manual;
|
||||||
@ -156,14 +154,11 @@ int apmf_update_fan_idx(struct amd_pmf_dev *pdev, bool manual, u32 idx)
|
|||||||
params.pointer = (void *)&args;
|
params.pointer = (void *)&args;
|
||||||
|
|
||||||
info = apmf_if_call(pdev, APMF_FUNC_SET_FAN_IDX, ¶ms);
|
info = apmf_if_call(pdev, APMF_FUNC_SET_FAN_IDX, ¶ms);
|
||||||
if (!info) {
|
if (!info)
|
||||||
err = -EIO;
|
return -EIO;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
kfree(info);
|
kfree(info);
|
||||||
return err;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int apmf_get_auto_mode_def(struct amd_pmf_dev *pdev, struct apmf_auto_mode *data)
|
int apmf_get_auto_mode_def(struct amd_pmf_dev *pdev, struct apmf_auto_mode *data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user