kernel: bump 5.10 to 5.10.163
[openwrt/openwrt.git] / target / linux / generic / backport-5.10 / 802-v5.12-0002-nvmem-imx-iim-Use-of_device_get_match_data.patch
1 From 579db09c6106977c0496f2cca48606b289df4bdf Mon Sep 17 00:00:00 2001
2 From: Fabio Estevam <festevam@gmail.com>
3 Date: Fri, 29 Jan 2021 17:14:27 +0000
4 Subject: [PATCH] nvmem: imx-iim: Use of_device_get_match_data()
5
6 The retrieval of driver data via of_device_get_match_data() can make
7 the code simpler.
8
9 Use of_device_get_match_data() to simplify the code.
10
11 Signed-off-by: Fabio Estevam <festevam@gmail.com>
12 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
13 Link: https://lore.kernel.org/r/20210129171430.11328-3-srinivas.kandagatla@linaro.org
14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 ---
16 drivers/nvmem/imx-iim.c | 7 +------
17 1 file changed, 1 insertion(+), 6 deletions(-)
18
19 --- a/drivers/nvmem/imx-iim.c
20 +++ b/drivers/nvmem/imx-iim.c
21 @@ -96,7 +96,6 @@ MODULE_DEVICE_TABLE(of, imx_iim_dt_ids);
22
23 static int imx_iim_probe(struct platform_device *pdev)
24 {
25 - const struct of_device_id *of_id;
26 struct device *dev = &pdev->dev;
27 struct iim_priv *iim;
28 struct nvmem_device *nvmem;
29 @@ -111,11 +110,7 @@ static int imx_iim_probe(struct platform
30 if (IS_ERR(iim->base))
31 return PTR_ERR(iim->base);
32
33 - of_id = of_match_device(imx_iim_dt_ids, dev);
34 - if (!of_id)
35 - return -ENODEV;
36 -
37 - drvdata = of_id->data;
38 + drvdata = of_device_get_match_data(&pdev->dev);
39
40 iim->clk = devm_clk_get(dev, NULL);
41 if (IS_ERR(iim->clk))