From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FF2043AB7; Mon, 21 Jul 2025 13:41:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753105299; cv=none; b=RJ1Vyi4ntYRqTFzfyRPCfoFO3uP+JD8wbzqDKoWfV23Wi5Bm4JSNLP7cVQxnSTE83lDWSkMhMP7YhD6PX3niy9XYmaMWjqDmSmw+2aYbMHbE4HahXdF8UfliZPLkRkrlKVLykT8QQUZQ9ykW5j82hCHGexpiMksSZWoN71Tm6N0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753105299; c=relaxed/simple; bh=fCaUNy1bbmR7aJ36J+3WanaPnZLmOnroe61ros3lflQ=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=kGiI2A1OizdYgtMDNk/7SbSPOakcB6PqVAdvo6mTJQcUO6QF6IxRgOMk8ahKJRepzYFmxCgVikYjHRcDVSN2WqMPVEBlMbdl0e5kFJ5LHNIzz45ue1ujvuxQ1ozjFE+acQCAHQPOacxWbYQZ69f89aUSrDvAM0AqejTe7g/KNX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fqtu77+a; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fqtu77+a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51077C4CEED; Mon, 21 Jul 2025 13:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753105298; bh=fCaUNy1bbmR7aJ36J+3WanaPnZLmOnroe61ros3lflQ=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=Fqtu77+aaI2r2JSzT1Be6IbOUxE8+3ZW0S3gR9XI/WurgG7dBuF0WBwtaC75hHju7 OjJSYip1YAq0+9ArXZ2L0MzmUJoGxoO59EvIsYpd3IozQbxUGOGbuaUWb/38IEoqVn tNIfQjw4QLKXlCLcypZVL5Qng7iZDnv6Kc8nod+BTGiaV+B13NPk5uXcbhNn5yUkT8 OVLeLx8WXVdkMVl8dkMaOU80tZYUT+SOUxWpjSeu+96c1VywsSAANqee8JnSpkqmbn XTNIbW0RKOI8Zsj+ZMfovHmTdUWRg7503/RIMNYnWdiqGV5d+fg1KhFiZR19e6o1++ Wo5dolFAOmppA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 21 Jul 2025 15:41:34 +0200 Message-Id: Subject: Re: [PATCH 2/3] device: rust: expand documentation for Device Cc: "Alice Ryhl" , , , , , , , , , , , To: "Greg KH" From: "Danilo Krummrich" References: <20250717224806.54763-1-dakr@kernel.org> <20250717224806.54763-3-dakr@kernel.org> <2025072125-twine-curling-db0b@gregkh> <2025072110-buddhism-accompany-0682@gregkh> In-Reply-To: <2025072110-buddhism-accompany-0682@gregkh> On Mon Jul 21, 2025 at 3:17 PM CEST, Greg KH wrote: > On Mon, Jul 21, 2025 at 02:13:14PM +0200, Danilo Krummrich wrote: >> On Mon Jul 21, 2025 at 2:07 PM CEST, Alice Ryhl wrote: >> > The connection is that to request an irq you must have a &Device, >> > so if you can only obtain a &Device to a bus device, then that >> > means that you can never request an irq for a class device. >>=20 >> As mentioned in my other reply, a class device never owns resources of a= "real" >> device such as an IRQ. >>=20 >> A USB device, which represents a real device on a bus, is a bus device, = in your >> example the class device is the input device. >> > > Just to confuse things a bit more (sorry), there are also "USB class > devices" that represent USB devices that use the "generic" USB interface > to userspace api. You can find these by searching for > usb_register_dev(). In this case the struct usb_interface represents a bus device, that can bec= ome associated with e.g. a class device of the usbmisc class. :) So, yeah, there are multiple USB devices, some of them are bus devices, som= e of them are class devices. I'm not sure about the exact topology, but AFAIK USB has different bus devi= ce types representing the hierarchy, i.e. a device structure for the entire "r= eal" USB device and another one for its interfaces. > Note, this is different from the drivers/usb/class/ drivers, which > represent various "USB class protocol" that the USB.org group defines, > and those talk to userspace through the various common class apis > depending on the specific device type (input, network, etc.) and are USB > bus drivers. > > Naming is hard, wait until you learn about "usb gadget" a word we had to > invent to describe the thing :) > > thanks, > > greg k-h