Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: renesas-ceu: Use of_device_get_match_data()

This driver can use the replacement API instead of calling
of_match_device() and then dereferencing the pointer that is returned.
This nicely avoids referencing the match table when it is undefined with
configurations where CONFIG_OF=n.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jacopo Mondi <jacopo@jmondi.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: <linux-media@vger.kernel.org>
Cc: <linux-renesas-soc@vger.kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210123034428.2841052-2-swboyd@chromium.org

authored by

Stephen Boyd and committed by
Rob Herring
a38f3fbc cb18a797

+1 -1
+1 -1
drivers/media/platform/renesas-ceu.c
··· 1679 1679 v4l2_async_notifier_init(&ceudev->notifier); 1680 1680 1681 1681 if (IS_ENABLED(CONFIG_OF) && dev->of_node) { 1682 - ceu_data = of_match_device(ceu_of_match, dev)->data; 1682 + ceu_data = of_device_get_match_data(dev); 1683 1683 num_subdevs = ceu_parse_dt(ceudev); 1684 1684 } else if (dev->platform_data) { 1685 1685 /* Assume SH4 if booting with platform data. */