kernel_optimize_test/drivers/soc/mediatek
Guenter Roeck 080f371d98 Revert "ASoC: mediatek: Check for error clk pointer"
This reverts commit d491a2c2cf which is
commit 9de2b9286a6dd16966959b3cb34fc2ddfd39213e 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 9de2b9286a6d needs to be
reverted.

Fixes: 9de2b9286a6d ("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:30:36 +01:00
..
Kconfig soc: mediatek: Enable mmsys driver by default if Mediatek arch is selected 2020-05-20 12:47:02 +02:00
Makefile clk / soc: mediatek: Move mt8173 MMSYS to platform driver 2020-04-13 13:01:16 +02:00
mtk-cmdq-helper.c soc: mediatek: cmdq: add clear option in cmdq_pkt_wfe api 2020-09-25 17:27:39 +02:00
mtk-infracfg.c soc: mediatek: mtk-infracfg: Fix kerneldoc 2020-09-25 17:27:24 +02:00
mtk-mmsys.c soc / drm: mediatek: Move DDP component defines into mtk-mmsys.h 2021-08-26 08:35:42 -04:00
mtk-pmic-wrap.c soc: mediatek: pwrap: add support for MT6359 PMIC 2020-02-17 11:07:25 +01:00
mtk-scpsys.c Revert "ASoC: mediatek: Check for error clk pointer" 2022-02-08 18:30:36 +01:00