Commit 89015f96 authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Takashi Iwai

ALSA: hda: cs35l41: Remove redundant argument to cs35l41_request_firmware_file()

In every case the 'dir' argument to cs35l41_request_firmware_file() is passed
the string "cirrus/", so this is a redundant argument and can be removed.
Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: default avatarStefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Message-ID: <20240411110813.330483-7-sbinding@opensource.cirrus.com>
parent 068fc7f3
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "hda_cs_dsp_ctl.h" #include "hda_cs_dsp_ctl.h"
#include "cs35l41_hda_property.h" #include "cs35l41_hda_property.h"
#define CS35L41_FIRMWARE_ROOT "cirrus/"
#define CS35L41_PART "cs35l41" #define CS35L41_PART "cs35l41"
#define HALO_STATE_DSP_CTL_NAME "HALO_STATE" #define HALO_STATE_DSP_CTL_NAME "HALO_STATE"
...@@ -171,7 +170,7 @@ static int cs35l41_request_tuning_param_file(struct cs35l41_hda *cs35l41, char * ...@@ -171,7 +170,7 @@ static int cs35l41_request_tuning_param_file(struct cs35l41_hda *cs35l41, char *
static int cs35l41_request_firmware_file(struct cs35l41_hda *cs35l41, static int cs35l41_request_firmware_file(struct cs35l41_hda *cs35l41,
const struct firmware **firmware, char **filename, const struct firmware **firmware, char **filename,
const char *dir, const char *ssid, const char *amp_name, const char *ssid, const char *amp_name,
int spkid, const char *filetype) int spkid, const char *filetype)
{ {
const char * const dsp_name = cs35l41->cs_dsp.name; const char * const dsp_name = cs35l41->cs_dsp.name;
...@@ -179,23 +178,23 @@ static int cs35l41_request_firmware_file(struct cs35l41_hda *cs35l41, ...@@ -179,23 +178,23 @@ static int cs35l41_request_firmware_file(struct cs35l41_hda *cs35l41,
int ret = 0; int ret = 0;
if (spkid > -1 && ssid && amp_name) if (spkid > -1 && ssid && amp_name)
*filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s-spkid%d-%s.%s", dir, CS35L41_PART, *filename = kasprintf(GFP_KERNEL, "cirrus/%s-%s-%s-%s-spkid%d-%s.%s", CS35L41_PART,
dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type], dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type],
ssid, spkid, amp_name, filetype); ssid, spkid, amp_name, filetype);
else if (spkid > -1 && ssid) else if (spkid > -1 && ssid)
*filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s-spkid%d.%s", dir, CS35L41_PART, *filename = kasprintf(GFP_KERNEL, "cirrus/%s-%s-%s-%s-spkid%d.%s", CS35L41_PART,
dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type], dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type],
ssid, spkid, filetype); ssid, spkid, filetype);
else if (ssid && amp_name) else if (ssid && amp_name)
*filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s-%s.%s", dir, CS35L41_PART, *filename = kasprintf(GFP_KERNEL, "cirrus/%s-%s-%s-%s-%s.%s", CS35L41_PART,
dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type], dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type],
ssid, amp_name, filetype); ssid, amp_name, filetype);
else if (ssid) else if (ssid)
*filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s.%s", dir, CS35L41_PART, *filename = kasprintf(GFP_KERNEL, "cirrus/%s-%s-%s-%s.%s", CS35L41_PART,
dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type], dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type],
ssid, filetype); ssid, filetype);
else else
*filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s.%s", dir, CS35L41_PART, *filename = kasprintf(GFP_KERNEL, "cirrus/%s-%s-%s.%s", CS35L41_PART,
dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type], dsp_name, hda_cs_dsp_fw_ids[cs35l41->firmware_type],
filetype); filetype);
...@@ -236,13 +235,11 @@ static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41, ...@@ -236,13 +235,11 @@ static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41,
/* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.wmfw */ /* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.wmfw */
ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename,
CS35L41_FIRMWARE_ROOT,
cs35l41->acpi_subsystem_id, cs35l41->amp_name, cs35l41->acpi_subsystem_id, cs35l41->amp_name,
cs35l41->speaker_id, "wmfw"); cs35l41->speaker_id, "wmfw");
if (!ret) { if (!ret) {
/* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */ /* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename,
CS35L41_FIRMWARE_ROOT,
cs35l41->acpi_subsystem_id, cs35l41->amp_name, cs35l41->acpi_subsystem_id, cs35l41->amp_name,
cs35l41->speaker_id, "bin"); cs35l41->speaker_id, "bin");
if (ret) if (ret)
...@@ -253,12 +250,11 @@ static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41, ...@@ -253,12 +250,11 @@ static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41,
/* try cirrus/part-dspN-fwtype-sub<-ampname>.wmfw */ /* try cirrus/part-dspN-fwtype-sub<-ampname>.wmfw */
ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename,
CS35L41_FIRMWARE_ROOT, cs35l41->acpi_subsystem_id, cs35l41->acpi_subsystem_id,
cs35l41->amp_name, -1, "wmfw"); cs35l41->amp_name, -1, "wmfw");
if (!ret) { if (!ret) {
/* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */ /* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename,
CS35L41_FIRMWARE_ROOT,
cs35l41->acpi_subsystem_id, cs35l41->amp_name, cs35l41->acpi_subsystem_id, cs35l41->amp_name,
cs35l41->speaker_id, "bin"); cs35l41->speaker_id, "bin");
if (ret) if (ret)
...@@ -269,18 +265,17 @@ static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41, ...@@ -269,18 +265,17 @@ static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41,
/* try cirrus/part-dspN-fwtype-sub<-spkidN>.wmfw */ /* try cirrus/part-dspN-fwtype-sub<-spkidN>.wmfw */
ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename,
CS35L41_FIRMWARE_ROOT, cs35l41->acpi_subsystem_id, cs35l41->acpi_subsystem_id,
NULL, cs35l41->speaker_id, "wmfw"); NULL, cs35l41->speaker_id, "wmfw");
if (!ret) { if (!ret) {
/* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */ /* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename,
CS35L41_FIRMWARE_ROOT,
cs35l41->acpi_subsystem_id, cs35l41->acpi_subsystem_id,
cs35l41->amp_name, cs35l41->speaker_id, "bin"); cs35l41->amp_name, cs35l41->speaker_id, "bin");
if (ret) if (ret)
/* try cirrus/part-dspN-fwtype-sub<-spkidN>.bin */ /* try cirrus/part-dspN-fwtype-sub<-spkidN>.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware,
coeff_filename, CS35L41_FIRMWARE_ROOT, coeff_filename,
cs35l41->acpi_subsystem_id, NULL, cs35l41->acpi_subsystem_id, NULL,
cs35l41->speaker_id, "bin"); cs35l41->speaker_id, "bin");
if (ret) if (ret)
...@@ -291,18 +286,17 @@ static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41, ...@@ -291,18 +286,17 @@ static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41,
/* try cirrus/part-dspN-fwtype-sub.wmfw */ /* try cirrus/part-dspN-fwtype-sub.wmfw */
ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename,
CS35L41_FIRMWARE_ROOT, cs35l41->acpi_subsystem_id, cs35l41->acpi_subsystem_id,
NULL, -1, "wmfw"); NULL, -1, "wmfw");
if (!ret) { if (!ret) {
/* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */ /* try cirrus/part-dspN-fwtype-sub<-spkidN><-ampname>.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename,
CS35L41_FIRMWARE_ROOT,
cs35l41->acpi_subsystem_id, cs35l41->amp_name, cs35l41->acpi_subsystem_id, cs35l41->amp_name,
cs35l41->speaker_id, "bin"); cs35l41->speaker_id, "bin");
if (ret) if (ret)
/* try cirrus/part-dspN-fwtype-sub<-spkidN>.bin */ /* try cirrus/part-dspN-fwtype-sub<-spkidN>.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware,
coeff_filename, CS35L41_FIRMWARE_ROOT, coeff_filename,
cs35l41->acpi_subsystem_id, NULL, cs35l41->acpi_subsystem_id, NULL,
cs35l41->speaker_id, "bin"); cs35l41->speaker_id, "bin");
if (ret) if (ret)
...@@ -329,13 +323,13 @@ static int cs35l41_fallback_firmware_file(struct cs35l41_hda *cs35l41, ...@@ -329,13 +323,13 @@ static int cs35l41_fallback_firmware_file(struct cs35l41_hda *cs35l41,
/* fallback try cirrus/part-dspN-fwtype.wmfw */ /* fallback try cirrus/part-dspN-fwtype.wmfw */
ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename,
CS35L41_FIRMWARE_ROOT, NULL, NULL, -1, "wmfw"); NULL, NULL, -1, "wmfw");
if (ret) if (ret)
goto err; goto err;
/* fallback try cirrus/part-dspN-fwtype.bin */ /* fallback try cirrus/part-dspN-fwtype.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename,
CS35L41_FIRMWARE_ROOT, NULL, NULL, -1, "bin"); NULL, NULL, -1, "bin");
if (ret) { if (ret) {
release_firmware(*wmfw_firmware); release_firmware(*wmfw_firmware);
kfree(*wmfw_filename); kfree(*wmfw_filename);
...@@ -364,12 +358,11 @@ static int cs35l41_request_firmware_files(struct cs35l41_hda *cs35l41, ...@@ -364,12 +358,11 @@ static int cs35l41_request_firmware_files(struct cs35l41_hda *cs35l41,
/* try cirrus/part-dspN-fwtype-sub<-ampname>.wmfw */ /* try cirrus/part-dspN-fwtype-sub<-ampname>.wmfw */
ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename,
CS35L41_FIRMWARE_ROOT, cs35l41->acpi_subsystem_id, cs35l41->acpi_subsystem_id,
cs35l41->amp_name, -1, "wmfw"); cs35l41->amp_name, -1, "wmfw");
if (!ret) { if (!ret) {
/* try cirrus/part-dspN-fwtype-sub<-ampname>.bin */ /* try cirrus/part-dspN-fwtype-sub<-ampname>.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename,
CS35L41_FIRMWARE_ROOT,
cs35l41->acpi_subsystem_id, cs35l41->amp_name, cs35l41->acpi_subsystem_id, cs35l41->amp_name,
-1, "bin"); -1, "bin");
if (ret) if (ret)
...@@ -380,18 +373,16 @@ static int cs35l41_request_firmware_files(struct cs35l41_hda *cs35l41, ...@@ -380,18 +373,16 @@ static int cs35l41_request_firmware_files(struct cs35l41_hda *cs35l41,
/* try cirrus/part-dspN-fwtype-sub.wmfw */ /* try cirrus/part-dspN-fwtype-sub.wmfw */
ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename, ret = cs35l41_request_firmware_file(cs35l41, wmfw_firmware, wmfw_filename,
CS35L41_FIRMWARE_ROOT, cs35l41->acpi_subsystem_id, cs35l41->acpi_subsystem_id,
NULL, -1, "wmfw"); NULL, -1, "wmfw");
if (!ret) { if (!ret) {
/* try cirrus/part-dspN-fwtype-sub<-ampname>.bin */ /* try cirrus/part-dspN-fwtype-sub<-ampname>.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename,
CS35L41_FIRMWARE_ROOT,
cs35l41->acpi_subsystem_id, cs35l41->acpi_subsystem_id,
cs35l41->amp_name, -1, "bin"); cs35l41->amp_name, -1, "bin");
if (ret) if (ret)
/* try cirrus/part-dspN-fwtype-sub.bin */ /* try cirrus/part-dspN-fwtype-sub.bin */
ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename, ret = cs35l41_request_firmware_file(cs35l41, coeff_firmware, coeff_filename,
CS35L41_FIRMWARE_ROOT,
cs35l41->acpi_subsystem_id, NULL, -1, cs35l41->acpi_subsystem_id, NULL, -1,
"bin"); "bin");
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment