Skip to content

Commit

Permalink
media: au0828: use signals instead of hardcoding a pad number
Browse files Browse the repository at this point in the history
When creating the audio link, use pad signals, instead of
hardcoding using the pad index number.

Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
mchehab committed Sep 17, 2018
1 parent f3efe15 commit 5e68d8e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/media/usb/au0828/au0828-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,13 @@ static void au0828_media_graph_notify(struct media_entity *new,

create_link:
if (decoder && mixer) {
ret = media_create_pad_link(decoder,
DEMOD_PAD_AUDIO_OUT,
mixer, 0,
MEDIA_LNK_FL_ENABLED);
if (ret)
ret = media_get_pad_index(decoder, false,
PAD_SIGNAL_AUDIO);
if (ret >= 0)
ret = media_create_pad_link(decoder, ret,
mixer, 0,
MEDIA_LNK_FL_ENABLED);
if (ret < 0)
dev_err(&dev->usbdev->dev,
"Mixer Pad Link Create Error: %d\n", ret);
}
Expand Down

0 comments on commit 5e68d8e

Please sign in to comment.