From: Kay Sievers Date: Tue, 01 Dec 2009 01:55:27 +0000 Subject: Re: udev keymaps: support for force_release quirk Message-Id: List-Id: References: <20091126173912.GA25185@sig21.net> In-Reply-To: <20091126173912.GA25185@sig21.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: linux-hotplug@vger.kernel.org On Tue, Dec 1, 2009 at 02:52, Johannes Stezenbach wrote: > On Mon, Nov 30, 2009 at 05:37:04PM -0800, Dmitry Torokhov wrote: >> On Tue, Dec 01, 2009 at 02:28:06AM +0100, Kay Sievers wrote: >> > On Tue, Dec 1, 2009 at 00:27, Johannes Stezenbach wrote: >> > > +       strncat(fn, "/device/device/force_release", sizeof(fn)); >> > >> > You can only select a parent device by it's subsystem/devtype. Any >> > hardcoded assumption about the order of parents is wrong, and the >> > "device" link is deprecated, it must not appear anywhere in udev code. > > I have to admit I have no clue how else to do it.  I'd be glad > to hear your advice. For udev it would be something like: udev_device_get_parent_with_subsystem_devtype(..., "serio", NULL); To find the first parent device which is a device on the "serio" bus. Kay