Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755218AbdLOJOw (ORCPT ); Fri, 15 Dec 2017 04:14:52 -0500 Received: from mga09.intel.com ([134.134.136.24]:43591 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754516AbdLOJOs (ORCPT ); Fri, 15 Dec 2017 04:14:48 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,404,1508828400"; d="scan'208";a="13724712" Date: Fri, 15 Dec 2017 11:14:44 +0200 From: Sakari Ailus To: Tomasz Figa Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Ivaylo Dimitrov , Sebastian Reichel , Laurent Pinchart , Hans Verkuil Subject: Re: [RFC PATCH] media: v4l2-device: Link subdevices to their parent devices if available Message-ID: <20171215091444.nbvqtbomc7henfnf@paasikivi.fi.intel.com> References: <20171215043221.242719-1-tfiga@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171215043221.242719-1-tfiga@chromium.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1071 Lines: 24 On Fri, Dec 15, 2017 at 01:32:21PM +0900, Tomasz Figa wrote: > Currently v4l2_device_register_subdev_nodes() does not initialize the > dev_parent field of the video_device structs it creates for subdevices > being registered. This leads to __video_register_device() falling back > to the parent device of associated v4l2_device struct, which often does > not match the physical device the subdevice is registered for. > > Due to the problem above, the links between real devices and v4l-subdev > nodes cannot be obtained from sysfs, which might be confusing for the > userspace trying to identify the hardware. > > Fix this by initializing the dev_parent field of the video_device struct > with the value of dev field of the v4l2_subdev struct. In case of > subdevices without a parent struct device, the field will be NULL and the > old behavior will be preserved by the semantics of > __video_register_device(). > > Signed-off-by: Tomasz Figa Acked-by: Sakari Ailus -- Sakari Ailus sakari.ailus@linux.intel.com