OpenCloudOS-Kernel/drivers/soc/mediatek
Guenter Roeck 946eb87114
ASoC: Revert "ASoC: mediatek: Check for error clk pointer"
This reverts commit 9de2b9286a ("ASoC: mediatek: Check for error clk
pointer").

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 ("ASoC:
mediatek: Check for error clk pointer") needs to be reverted.

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>
Reported-by: Frank Wunderlich <frank-w@public-files.de>
Reported-by: Daniel Golle <daniel@makrotopia.org>
Fixes: 9de2b9286a ("ASoC: mediatek: Check for error clk pointer")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220207160923.3911501-1-linux@roeck-us.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-02-08 13:37:39 +00:00
..
Kconfig soc: mediatek: mmsys: Specify HAS_IOMEM dependency for MTK_MMSYS 2020-12-10 15:33:56 +01:00
Makefile soc / drm: mediatek: Move mtk mutex driver to soc folder 2021-02-04 22:55:46 +08:00
mt8167-mmsys.h soc: mediatek: mmsys: Add support for MT8167 SoC 2021-04-06 12:57:10 +02:00
mt8167-pm-domains.h soc: mediatek: pm-domains: Add a power domain names for mt8167 2021-04-01 11:36:04 +02:00
mt8173-pm-domains.h soc: mediatek: pm-domains: Add domain_supply cap for mfg_async PD 2021-07-12 12:26:29 +02:00
mt8183-mmsys.h soc: mmsys: mediatek: add mask to mmsys routes 2021-08-04 19:05:46 +02:00
mt8183-pm-domains.h soc: mediatek: pm-domains: Add a power domain names for mt8183 2021-04-01 11:36:04 +02:00
mt8192-mmsys.h soc: mediatek: mmsys: Add mt8192 mmsys routing table 2021-09-13 10:52:13 +02:00
mt8192-pm-domains.h soc: mediatek: pm-domains: Add a power domain names for mt8192 2021-04-01 11:36:04 +02:00
mt8365-mmsys.h soc: mediatek: mmsys: add MT8365 support 2021-08-06 16:43:23 +02:00
mtk-cmdq-helper.c soc: mediatek: cmdq: Remove cmdq_pkt_flush() 2021-01-31 12:35:46 +01:00
mtk-devapc.c soc: mediatek: add missing MODULE_DEVICE_TABLE 2021-05-12 18:29:37 +02:00
mtk-infracfg.c soc: mediatek: pm_domains: Make bus protection generic 2020-11-27 12:04:42 +01:00
mtk-mmsys.c soc: mediatek: mmsys: Add reset controller support 2021-10-08 15:15:26 +02:00
mtk-mmsys.h soc: mediatek: mmsys: Add reset controller support 2021-10-08 15:15:26 +02:00
mtk-mutex.c soc: mediatek: add mtk mutex support for MT8192 2021-10-08 13:25:43 +02:00
mtk-pm-domains.c soc: mtk-pm-domains: Fix the clock prepared issue 2021-06-02 13:53:31 +02:00
mtk-pm-domains.h soc: mediatek: pm-domains: Use correct mask for bus_prot_clr 2021-07-12 12:26:28 +02:00
mtk-pmic-wrap.c soc: mediatek: pwrap: add pwrap driver for MT8195 SoC 2021-06-03 19:41:26 +02:00
mtk-scpsys.c ASoC: Revert "ASoC: mediatek: Check for error clk pointer" 2022-02-08 13:37:39 +00:00