This probe function is only called if the device is backed by a DT node,
so switch this call to of_device_get_match_data() to reduce code size
and simplify a bit. This also avoids needing to reference a potentially
undefined variable because of_device_get_match_data() doesn't need to
know anything beyond the struct device to find the match table.

Cc: Arnd Bergmann <a...@arndb.de>
Cc: Geert Uytterhoeven <ge...@linux-m68k.org>
Cc: Paul Cercueil <p...@crapouillou.net>
Cc: Liam Girdwood <lgirdw...@gmail.com>
Cc: Mark Brown <broo...@kernel.org>
Cc: Jaroslav Kysela <pe...@perex.cz>
Cc: Takashi Iwai <ti...@suse.com>
Cc: Rob Herring <robh...@kernel.org>
Cc: Frank Rowand <frowand.l...@gmail.com>
Cc: <alsa-de...@alsa-project.org>
Signed-off-by: Stephen Boyd <swb...@chromium.org>
---

Please ack or pick for immediate merge so the last patch can be merged.

 sound/soc/jz4740/jz4740-i2s.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/jz4740/jz4740-i2s.c b/sound/soc/jz4740/jz4740-i2s.c
index 13408de34055..d2dab4d24b87 100644
--- a/sound/soc/jz4740/jz4740-i2s.c
+++ b/sound/soc/jz4740/jz4740-i2s.c
@@ -503,9 +503,8 @@ static int jz4740_i2s_dev_probe(struct platform_device 
*pdev)
        if (!i2s)
                return -ENOMEM;
 
-       match = of_match_device(jz4740_of_matches, &pdev->dev);
-       if (match)
-               i2s->version = (enum jz47xx_i2s_version)match->data;
+       i2s->version =
+               (enum jz47xx_i2s_version)of_device_get_match_data(&pdev->dev);
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        i2s->base = devm_ioremap_resource(&pdev->dev, mem);
-- 
Sent by a computer through tubes

Reply via email to