|
@@ -2930,17 +2930,7 @@ static void lpass_cdc_wsa_macro_add_child_devices(struct work_struct *work)
|
|
|
__func__, ctrl_num);
|
|
|
goto fail_pdev_add;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- ret = platform_device_add(pdev);
|
|
|
- if (ret) {
|
|
|
- dev_err(&pdev->dev,
|
|
|
- "%s: Cannot add platform device\n",
|
|
|
- __func__);
|
|
|
- goto fail_pdev_add;
|
|
|
- }
|
|
|
|
|
|
- if (!strcmp(node->name, "wsa_swr_master")) {
|
|
|
temp = krealloc(swr_ctrl_data,
|
|
|
(ctrl_num + 1) * sizeof(
|
|
|
struct lpass_cdc_wsa_macro_swr_ctrl_data),
|
|
@@ -2948,16 +2938,25 @@ static void lpass_cdc_wsa_macro_add_child_devices(struct work_struct *work)
|
|
|
if (!temp) {
|
|
|
dev_err(&pdev->dev, "out of memory\n");
|
|
|
ret = -ENOMEM;
|
|
|
- goto err;
|
|
|
+ goto fail_pdev_add;
|
|
|
}
|
|
|
swr_ctrl_data = temp;
|
|
|
swr_ctrl_data[ctrl_num].wsa_swr_pdev = pdev;
|
|
|
ctrl_num++;
|
|
|
dev_dbg(&pdev->dev,
|
|
|
- "%s: Added soundwire ctrl device(s)\n",
|
|
|
+ "%s: Adding soundwire ctrl device(s)\n",
|
|
|
__func__);
|
|
|
wsa_priv->swr_ctrl_data = swr_ctrl_data;
|
|
|
}
|
|
|
+
|
|
|
+ ret = platform_device_add(pdev);
|
|
|
+ if (ret) {
|
|
|
+ dev_err(&pdev->dev,
|
|
|
+ "%s: Cannot add platform device\n",
|
|
|
+ __func__);
|
|
|
+ goto fail_pdev_add;
|
|
|
+ }
|
|
|
+
|
|
|
if (wsa_priv->child_count < LPASS_CDC_WSA_MACRO_CHILD_DEVICES_MAX)
|
|
|
wsa_priv->pdev_child_devices[
|
|
|
wsa_priv->child_count++] = pdev;
|