From patchwork Thu Sep 3 16:00:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 7117751 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AC3C0BEEC1 for ; Thu, 3 Sep 2015 16:04:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D057F20792 for ; Thu, 3 Sep 2015 16:04:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E308420796 for ; Thu, 3 Sep 2015 16:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932382AbbICQDy (ORCPT ); Thu, 3 Sep 2015 12:03:54 -0400 Received: from lists.s-osg.org ([54.187.51.154]:33917 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933548AbbICQBD (ORCPT ); Thu, 3 Sep 2015 12:01:03 -0400 Received: from localhost.localdomain (69.191.21.95.dynamic.jazztel.es [95.21.191.69]) by lists.s-osg.org (Postfix) with ESMTPSA id 048934632C; Thu, 3 Sep 2015 09:00:59 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Hans Verkuil , Javier Martinez Canillas , Mauro Carvalho Chehab , linux-sh@vger.kernel.org, Laurent Pinchart , linux-media@vger.kernel.org Subject: [PATCH 2/5] [media] v4l: vsp1: create pad links after subdev registration Date: Thu, 3 Sep 2015 18:00:33 +0200 Message-Id: <1441296036-20727-3-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1441296036-20727-1-git-send-email-javier@osg.samsung.com> References: <1441296036-20727-1-git-send-email-javier@osg.samsung.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The vsp1 driver creates the pads links before the media entities are registered with the media device. This doesn't work now that object IDs are used to create links so the media_device has to be set. Move entities registration logic before pads links creation. Signed-off-by: Javier Martinez Canillas Acked-by: Laurent Pinchart --- drivers/media/platform/vsp1/vsp1_drv.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c index 9cd94a76a9ed..2aa427d3ff39 100644 --- a/drivers/media/platform/vsp1/vsp1_drv.c +++ b/drivers/media/platform/vsp1/vsp1_drv.c @@ -250,6 +250,14 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) list_add_tail(&wpf->entity.list_dev, &vsp1->entities); } + /* Register all subdevs. */ + list_for_each_entry(entity, &vsp1->entities, list_dev) { + ret = v4l2_device_register_subdev(&vsp1->v4l2_dev, + &entity->subdev); + if (ret < 0) + goto done; + } + /* Create links. */ list_for_each_entry(entity, &vsp1->entities, list_dev) { if (entity->type == VSP1_ENTITY_LIF || @@ -269,14 +277,6 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) return ret; } - /* Register all subdevs. */ - list_for_each_entry(entity, &vsp1->entities, list_dev) { - ret = v4l2_device_register_subdev(&vsp1->v4l2_dev, - &entity->subdev); - if (ret < 0) - goto done; - } - ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev); done: