c055f0096ddc551fba2f6937721488160007f167
[openwrt/openwrt.git] / target / linux / ramips / patches-5.15 / 107-v6.2-PCI-mt7621-Add-sentinel-to-quirks-table.patch
1 From 19098934f910b4d47cb30251dd39ffa57bef9523 Mon Sep 17 00:00:00 2001
2 From: John Thomson <git@johnthomson.fastmail.com.au>
3 Date: Tue, 6 Dec 2022 06:46:45 +1000
4 Subject: [PATCH] PCI: mt7621: Add sentinel to quirks table
5
6 Current driver is missing a sentinel in the struct soc_device_attribute
7 array, which causes an oops when assessed by the
8 soc_device_match(mt7621_pcie_quirks_match) call.
9
10 This was only exposed once the CONFIG_SOC_MT7621 mt7621 soc_dev_attr
11 was fixed to register the SOC as a device, in:
12
13 commit 7c18b64bba3b ("mips: ralink: mt7621: do not use kzalloc too early")
14
15 Fix it by adding the required sentinel.
16
17 Link: https://lore.kernel.org/lkml/26ebbed1-0fe9-4af9-8466-65f841d0b382@app.fastmail.com
18 Link: https://lore.kernel.org/r/20221205204645.301301-1-git@johnthomson.fastmail.com.au
19 Fixes: b483b4e4d3f6 ("staging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute'")
20 Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
21 Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
22 Acked-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
23 ---
24 drivers/pci/controller/pcie-mt7621.c | 3 ++-
25 1 file changed, 2 insertions(+), 1 deletion(-)
26
27 --- a/drivers/pci/controller/pcie-mt7621.c
28 +++ b/drivers/pci/controller/pcie-mt7621.c
29 @@ -471,7 +471,8 @@ static int mt7621_pcie_register_host(str
30 }
31
32 static const struct soc_device_attribute mt7621_pcie_quirks_match[] = {
33 - { .soc_id = "mt7621", .revision = "E2" }
34 + { .soc_id = "mt7621", .revision = "E2" },
35 + { /* sentinel */ }
36 };
37
38 static int mt7621_pcie_probe(struct platform_device *pdev)