Skip to content

Commit ae3c253

Browse files
arndbmchehab
authored andcommitted
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: b385b99 ("media: platform: mtk-mdp3: chip config split about subcomponents") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 55e2a6e commit ae3c253

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,6 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
10351035
{
10361036
struct device *dev = &mdp->pdev->dev;
10371037
struct device_node *node, *parent;
1038-
const struct mtk_mdp_driver_data *data = mdp->mdp_data;
10391038

10401039
parent = dev->of_node->parent;
10411040

@@ -1045,7 +1044,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
10451044
int id, alias_id;
10461045
struct mdp_comp *comp;
10471046

1048-
of_id = of_match_node(data->mdp_sub_comp_dt_ids, node);
1047+
of_id = of_match_node(mdp->mdp_data->mdp_sub_comp_dt_ids, node);
10491048
if (!of_id)
10501049
continue;
10511050
if (!of_device_is_available(node)) {

0 commit comments

Comments
 (0)