Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions sound/soc/sof/intel/hda-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@
#define IDISP_VID_INTEL 0x80860000

/* load the legacy HDA codec driver */
#ifdef MODULE
static void hda_codec_load_module(struct hda_codec *codec)
static int hda_codec_load_module(struct hda_codec *codec)
{
#ifdef MODULE
char alias[MODULE_NAME_LEN];
const char *module = alias;

snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias));
dev_dbg(&codec->core.dev, "loading codec module: %s\n", module);
request_module(module);
}
#else
static void hda_codec_load_module(struct hda_codec *codec) {}
#endif
return device_attach(hda_codec_dev(codec));
}

/* check jack status after resuming from suspend mode */
void hda_codec_jack_check(struct snd_sof_dev *sdev, int status)
Expand Down Expand Up @@ -131,10 +130,16 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
(resp & 0xFFFF0000) != IDISP_VID_INTEL) {
hdev->type = HDA_DEV_LEGACY;
hda->hda_codec_mask |= BIT(address);
hda_codec_load_module(&hda_priv->codec);
ret = hda_codec_load_module(&hda_priv->codec);
/*
* handle ret==0 (no driver bound) as an error, but pass
* other return codes without modification
*/
if (ret == 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think checkpatch suggests to use if (!ret) in such cases

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh I had that in the original version, but as the return value is a more complex enumeration (both positive and negative values have specific meanings), I wanted to highlight zero on purpose.
Original review to sof-dev is at: #1679

ret = -ENOENT;
}

return 0;
return ret;
#else
/* snd_hdac_ext_bus_device_exit will use kfree to free hdev */
hdev = kzalloc(sizeof(*hdev), GFP_KERNEL);
Expand Down