]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: fsl_ssi: Use of_device_get_match_data()
authorFabio Estevam <festevam@gmail.com>
Mon, 18 Jan 2021 12:38:10 +0000 (09:38 -0300)
committerMark Brown <broonie@kernel.org>
Wed, 20 Jan 2021 18:47:30 +0000 (18:47 +0000)
The retrieval of driver data via of_device_get_match_data() can make
the code simpler.

Use of_device_get_match_data() to simplify the code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118123815.1630882-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_ssi.c

index 404be27c15fed87b1083e2258a91fdb9dfd885c7..db4ba5f22b7749fe6cba54e47042cd251ee66de3 100644 (file)
@@ -1397,18 +1397,11 @@ static int fsl_ssi_probe_from_dt(struct fsl_ssi *ssi)
 {
        struct device *dev = ssi->dev;
        struct device_node *np = dev->of_node;
-       const struct of_device_id *of_id;
        const char *p, *sprop;
        const __be32 *iprop;
        u32 dmas[4];
        int ret;
 
-       of_id = of_match_device(fsl_ssi_ids, dev);
-       if (!of_id || !of_id->data)
-               return -EINVAL;
-
-       ssi->soc = of_id->data;
-
        ret = of_property_match_string(np, "clock-names", "ipg");
        /* Get error code if not found */
        ssi->has_ipg_clk_name = ret >= 0;
@@ -1492,6 +1485,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        ssi->dev = dev;
+       ssi->soc = of_device_get_match_data(&pdev->dev);
 
        /* Probe from DT */
        ret = fsl_ssi_probe_from_dt(ssi);