linux-stable/drivers
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
..
accessibility
acpi
amba
android
ata libata: libahci: declare ahci_shost_attr_group as static 2021-11-12 08:05:47 +09:00
atm
auxdisplay
base arch_topology: Fix missing clear cluster_cpumask in remove_cpu_topology() 2021-11-11 13:09:33 +01:00
bcma
block
bluetooth
bus - Config updates for BMIPS platform 2021-11-13 09:11:33 -08:00
cdrom
char
clk Devicetree fixes for v5.16, take 1: 2021-11-14 11:11:51 -08:00
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma dmaengine: xilinx_dpdma: stop using slave_id field 2021-12-17 11:23:56 +05:30
dma-buf drm next/fixes for 5.16-rc1 2021-11-12 12:11:07 -08:00
edac
eisa
extcon
firewire
firmware firmware: cs_dsp: Clear core reset for cache 2022-01-05 13:53:53 +00:00
fpga
fsi
gnss
gpio
gpu dmaengine: xilinx_dpdma: stop using slave_id field 2021-12-17 11:23:56 +05:30
greybus
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband
input Input: wm97xx: Simplify resource management 2022-01-31 13:17:24 +00:00
interconnect
iommu
ipack
irqchip irqchip/sifive-plic: Fixup EOI failed when masked 2021-11-12 16:09:51 +00:00
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc mmc: bcm2835: stop setting chan_config->slave_id 2021-12-17 11:23:56 +05:30
most
mtd dmaengine: qcom-adm: stop abusing slave_id config 2021-12-17 11:23:56 +05:30
mux
net Networking fixes for 5.16-rc1, including fixes from bpf, can 2021-11-11 09:49:36 -08:00
nfc
ntb
nubus
nvdimm
nvme
nvmem
of Devicetree fixes for v5.16, take 1: 2021-11-14 11:11:51 -08:00
opp
parisc
parport
pci A set of fixes for the interrupt subsystem: 2021-11-14 10:38:27 -08:00
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc RTC for 5.16 2021-11-12 11:44:31 -08:00
s390
sbus
scsi SCSI misc on 20211112 2021-11-12 12:25:50 -08:00
sh
siox
slimbus
soc ASoC: Revert "ASoC: mediatek: Check for error clk pointer" 2022-02-08 13:37:39 +00:00
soundwire soundwire: intel: remove PDM support 2021-12-24 14:06:50 +00:00
spi spi: pic32: stop setting dma_config->slave_id 2021-12-17 11:23:56 +05:30
spmi
ssb
staging Merge branch 'exit-cleanups-for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2021-11-10 16:15:54 -08:00
target SCSI misc on 20211112 2021-11-12 12:25:50 -08:00
tc
tee
thermal thermal: int340x: fix build on 32-bit targets 2021-11-12 10:56:25 -08:00
thunderbolt
tty dmaengine: qcom-adm: stop abusing slave_id config 2021-12-17 11:23:56 +05:30
uio
usb USB fixes for 5.16-rc1 2021-11-11 09:40:15 -08:00
vdpa
vfio
vhost
video drm next/fixes for 5.16-rc1 2021-11-12 12:11:07 -08:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile