From patchwork Wed Aug 1 15:55:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10552567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E9B4139A for ; Wed, 1 Aug 2018 15:55:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EE352A163 for ; Wed, 1 Aug 2018 15:55:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82E172A20C; Wed, 1 Aug 2018 15:55:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 365242A163 for ; Wed, 1 Aug 2018 15:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389918AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56462 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389812AbeHARln (ORCPT ); Wed, 1 Aug 2018 13:41:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gFolxMOovmChDte/cboRdPFOhpNtmzeGuUOylG2cWdY=; b=hrKbGU3sRm5bXNShNJzPm+AkF 6rjKe7EnK/k/n/vq7RrOsbz6DWV26U+7OCsUhOonkA9dUEdLkmghZph6o4atTwAOKN05H+Of6qLsU QPICMb7i1Rs+2kL8GEe2GsBZ3FzX4SE23ixQciApAtmoPl7wLABRNukKgOeBcwDzFp9CZcjXVuhBJ m0QOw46RRNwYflIDly76GT20bdlNl8bq4UX6MvRfWUW1JXouJU0aAdF4h6u3+hfF4i8TiCcnazS7+ 5elYLHQ4vaZ2l5no5ID8xyy9kB7iZSx6ESyBXeyzCpe/GfkxqE7UHvYoA8fItpjSRYd/OqPcsLTlE ZBa5CZaAQ==; Received: from [179.182.165.210] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktT7-0005nv-Gp; Wed, 01 Aug 2018 15:55:21 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fktT5-0003wd-70; Wed, 01 Aug 2018 12:55:19 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , "Gustavo A. R. Silva" Subject: [PATCH 05/13] media: au0828: use signals instead of hardcoding a pad number Date: Wed, 1 Aug 2018 12:55:07 -0300 Message-Id: <652a795df24165d6dbf93d31a1f3ea10b65ed989.1533138685.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When creating the audio link, use pad signals, instead of hardcoding using the pad index number. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/au0828/au0828-core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index cd363a2100d4..4729b2a2f21c 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -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); }