From patchwork Tue Oct 20 01:12:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 54903 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9K8FPCu029549 for ; Tue, 20 Oct 2009 08:15:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751327AbZJTIOw (ORCPT ); Tue, 20 Oct 2009 04:14:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751148AbZJTIOv (ORCPT ); Tue, 20 Oct 2009 04:14:51 -0400 Received: from mailrelay009.isp.belgacom.be ([195.238.6.176]:43811 "EHLO mailrelay009.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751216AbZJTIOp (ORCPT ); Tue, 20 Oct 2009 04:14:45 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvAEANsO3UpR9RAV/2dsb2JhbABDkCjIH4QxBA Received: from 21.16-245-81.adsl-static.isp.belgacom.be (HELO ravenclaw) ([81.245.16.21]) by relay.skynet.be with SMTP; 20 Oct 2009 10:14:44 +0200 Received: by ravenclaw (sSMTP sendmail emulation); Tue, 20 Oct 2009 10:14:57 +0200 Message-Id: <20091020011214.954146615@ideasonboard.com> User-Agent: quilt/0.48-1 Date: Tue, 20 Oct 2009 03:12:13 +0200 From: laurent.pinchart@ideasonboard.com To: linux-media@vger.kernel.org Cc: sakari.ailus@maxwell.research.nokia.com, hverkuil@xs4all.nl, Laurent Pinchart Subject: [RFC/PATCH 03/14] v4l-mc: Replace the active pads bitmask by a link flag References: <20091020011210.623421213@ideasonboard.com> Content-Disposition: inline; filename=v4l-mc-replace-active-bitflag.diff Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Index: v4l-dvb-mc/linux/drivers/media/video/v4l2-device.c =================================================================== --- v4l-dvb-mc.orig/linux/drivers/media/video/v4l2-device.c +++ v4l-dvb-mc/linux/drivers/media/video/v4l2-device.c @@ -145,10 +145,8 @@ static long mc_enum_links(struct v4l2_de for (l = 0; l < ent->pads; l++, s++) { struct v4l2_mc_io_status stat = { 0, 0 }; - if (ent->links) { - stat.active_pads = ent->links[l].active; + if (ent->links) stat.nr_of_remote_pads = ent->links[l].nr_of_remote_pads; - } if (copy_to_user(uios->status + s, &stat, sizeof(stat))) return -EFAULT; } Index: v4l-dvb-mc/linux/include/linux/videodev2.h =================================================================== --- v4l-dvb-mc.orig/linux/include/linux/videodev2.h +++ v4l-dvb-mc/linux/include/linux/videodev2.h @@ -1560,10 +1560,10 @@ struct v4l2_dbg_chip_ident { struct v4l2_mc_io { __u32 entity; /* entity ID */ __u8 pad; /* pad index */ + __u8 active; /* link is active */ }; struct v4l2_mc_io_status { - __u32 active_pads; __u8 nr_of_remote_pads; __u32 type; /* pad type */ }; Index: v4l-dvb-mc/linux/include/media/v4l2-mc.h =================================================================== --- v4l-dvb-mc.orig/linux/include/media/v4l2-mc.h +++ v4l-dvb-mc/linux/include/media/v4l2-mc.h @@ -4,7 +4,6 @@ #include struct v4l2_entity_io { - u32 active; /* bitmask of active remote pads */ u8 nr_of_remote_pads; /* number of remote pads */ struct v4l2_mc_io *remote_pads; /* specify possible remote pads */ }; @@ -68,10 +67,10 @@ static inline void v4l2_entity_connect(s sink_link = sink->pads++; source->links[source_link].remote_pads[0].entity = sink->id; source->links[source_link].remote_pads[0].pad = sink_link; - source->links[source_link].active = active; + source->links[source_link].remote_pads[0].active = active; sink->links[sink_link].remote_pads[0].entity = source->id; sink->links[sink_link].remote_pads[0].pad = source_link; - sink->links[sink_link].active = active; + sink->links[sink_link].remote_pads[0].active = active; } #endif