From patchwork Tue Sep 22 17:19:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 7241801 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 37C839F443 for ; Tue, 22 Sep 2015 17:29:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03F1D209D3 for ; Tue, 22 Sep 2015 17:29:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35061209CF for ; Tue, 22 Sep 2015 17:29:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758496AbbIVR3G (ORCPT ); Tue, 22 Sep 2015 13:29:06 -0400 Received: from resqmta-po-05v.sys.comcast.net ([96.114.154.164]:46399 "EHLO resqmta-po-05v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758790AbbIVR2F (ORCPT ); Tue, 22 Sep 2015 13:28:05 -0400 Received: from resomta-po-18v.sys.comcast.net ([96.114.154.242]) by resqmta-po-05v.sys.comcast.net with comcast id LHJE1r0035E3ZMc01HKu0e; Tue, 22 Sep 2015 17:19:54 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-18v.sys.comcast.net with comcast id LHKp1r00M1LXgTt01HKtSn; Tue, 22 Sep 2015 17:19:54 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id E3618A153E; Tue, 22 Sep 2015 11:19:52 -0600 (MDT) From: Shuah Khan To: mchehab@osg.samsung.com, hans.verkuil@cisco.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, tiwai@suse.de, pawel@osciak.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, perex@perex.cz, stefanr@s5r6.in-berlin.de, crope@iki.fi, dan.carpenter@oracle.com, tskd08@gmail.com, ruchandani.tina@gmail.com, arnd@arndb.de, chehabrafael@gmail.com, prabhakar.csengg@gmail.com, Julia.Lawall@lip6.fr, elfring@users.sourceforge.net, ricardo.ribalda@gmail.com, chris.j.arges@canonical.com, pierre-louis.bossart@linux.intel.com, gtmkramer@xs4all.nl, clemens@ladisch.de, misterpib@gmail.com, takamichiho@gmail.com, pmatilai@laiskiainen.org, damien@zamaudio.com, daniel@zonque.org, vladcatoi@gmail.com, normalperson@yhbt.net, joe@oampo.co.uk, bugzilla.frnkcg@spamgourmet.com, jussi@sonarnerd.net Cc: Shuah Khan , linux-media@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH v3 12/21] media: au0828 fix au0828_create_media_graph() entity checks Date: Tue, 22 Sep 2015 11:19:31 -0600 Message-Id: <9a717e8f411fc1a1bac2c984f154ada401a9186c.1442937669.git.shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1442942394; bh=PwT2yKDM0gkYZlS4DGTfRnVtgcv8AMxESgSCrJLLToE=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=XP2PnRSNWoDx1lYcFvAhYRb8lUjEMhBQEndkjtjjyPv+x+BwzBduMFmcQQl8QD8Ek SNxe06r75Ypm8xQfJvRhQYGXrJPQjqt1H4a/30pbE0MgW/OE50IODwjHFdYqtjakTs wXOLnzCAXfMKyP6nSJWsi9vRYdLB8GeZgyq3W4fydpTKBQdIQ/bZRSFz/AWm8L3sHq kjasQiVBCIXTMgYGrXgYyKfEzO1ChGN/Py47UNeswjmPSWDr/I6boA34RjDdJ5XHZq tdS4hxxyfTBktAJUK7Cg3K/kVhfa/r8PrRN3tmOUHqkbg+355/N9PkhMKh0ND4rPWs iZU6GufSWKgzw== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP au0828_create_media_graph() checks if entity.links is null or not to determine, if vbi_dev and vdev entities have been registered. Checking entity.parent field is right way, as parent field gets initialized when entity is registered. Fix it to check entity.parent field. Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 276598b..0b8dc49 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -263,11 +263,11 @@ static void au0828_create_media_graph(struct au0828_dev *dev) if (tuner) media_entity_create_link(tuner, 0, decoder, 0, MEDIA_LNK_FL_ENABLED); - if (dev->vdev.entity.links) + if (dev->vdev.entity.parent) media_entity_create_link(decoder, AU8522_PAD_VID_OUT, &dev->vdev.entity, 0, MEDIA_LNK_FL_ENABLED); - if (dev->vbi_dev.entity.links) + if (dev->vbi_dev.entity.parent) media_entity_create_link(decoder, AU8522_PAD_VBI_OUT, &dev->vbi_dev.entity, 0, MEDIA_LNK_FL_ENABLED);