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

media: platform: mtk-mdp3: work around unused-variable warning

When CONFIG_OF is disabled, the 'data' variable is not used at all
because of_match_node() turns into a dummy macro:

drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c: In function 'mdp_comp_sub_create':
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:1038:36: error: unused variable 'data' [-Werror=unused-variable]
1038 | const struct mtk_mdp_driver_data *data = mdp->mdp_data;
| ^~~~

Remove the variable again by moving the pointer dereference into the
of_match_node call.

Fixes: b385b991ef2f ("media: platform: mtk-mdp3: chip config split about subcomponents")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Arnd Bergmann and committed by
Mauro Carvalho Chehab
ae3c253f 55e2a6e3

+1 -2
+1 -2
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
··· 1035 1035 { 1036 1036 struct device *dev = &mdp->pdev->dev; 1037 1037 struct device_node *node, *parent; 1038 - const struct mtk_mdp_driver_data *data = mdp->mdp_data; 1039 1038 1040 1039 parent = dev->of_node->parent; 1041 1040 ··· 1044 1045 int id, alias_id; 1045 1046 struct mdp_comp *comp; 1046 1047 1047 - of_id = of_match_node(data->mdp_sub_comp_dt_ids, node); 1048 + of_id = of_match_node(mdp->mdp_data->mdp_sub_comp_dt_ids, node); 1048 1049 if (!of_id) 1049 1050 continue; 1050 1051 if (!of_device_is_available(node)) {