linux-stable/drivers/soc
Guenter Roeck 2f837785c2 Revert "ASoC: mediatek: Check for error clk pointer"
This reverts commit 8b894d503e which is
commit 9de2b9286a upstream

With this patch in the tree, Chromebooks running the affected hardware
no longer boot. Bisect points to this patch, and reverting it fixes
the problem.

An analysis of the code with this patch applied shows:

        ret = init_clks(pdev, clk);
        if (ret)
                return ERR_PTR(ret);
...
                for (j = 0; j < MAX_CLKS && data->clk_id[j]; j++) {
                        struct clk *c = clk[data->clk_id[j]];

                        if (IS_ERR(c)) {
                                dev_err(&pdev->dev, "%s: clk unavailable\n",
                                        data->name);
                                return ERR_CAST(c);
                        }

                        scpd->clk[j] = c;
                }

Not all clocks in the clk_names array have to be present. Only the clocks
in the data->clk_id array are actually needed. The code already checks if
the required clocks are available and bails out if not. The assumption that
all clocks have to be present is wrong, and commit 9de2b9286a needs to be
reverted.

Fixes: 9de2b9286a ("ASoC: mediatek: Check for error clk pointer")
Cc: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: Mark Brown <broonie@kernel.org>
Cc: James Liao <jamesjj.liao@mediatek.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com
Cc: Frank Wunderlich <frank-w@public-files.de>
Cc: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/lkml/20220205014755.699603-1-linux@roeck-us.net/
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-08 18:24:28 +01:00
..
actions
amlogic soc: amlogic: canvas: add missing put_device() call in meson_canvas_get() 2020-12-30 11:51:15 +01:00
aspeed soc: aspeed: p2a-ctrl: Fix boundary check for mmap 2021-09-22 12:26:20 +02:00
atmel drivers: soc: atmel: add null entry at the end of at91_soc_allowed_list[] 2021-02-03 23:25:57 +01:00
bcm
dove
fsl soc: fsl: dpaa2-console: free buffer before returning from dpaa2_console_read 2021-11-17 09:48:45 +01:00
gemini
imx
ixp4xx soc: ixp4xx/qmgr: fix invalid __iomem access 2021-08-12 13:21:04 +02:00
lantiq
mediatek Revert "ASoC: mediatek: Check for error clk pointer" 2022-02-08 18:24:28 +01:00
qcom soc: qcom: mdt_loader: Drop PT_LOAD check on hash segment 2021-10-13 10:08:18 +02:00
renesas soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains() 2020-12-30 11:51:01 +01:00
rockchip soc: rockchip: ROCKCHIP_GRF should not default to y, unconditionally 2021-09-15 09:47:30 +02:00
samsung
sunxi
tegra soc/tegra: fuse: Fix bitwise vs. logical OR warning 2021-12-22 09:29:37 +01:00
ti drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe 2020-12-30 11:51:10 +01:00
ux500
versatile
xilinx
zte
Kconfig
Makefile