From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6308EE78493 for ; Sun, 1 Oct 2023 21:23:27 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1qn3tt-0002yf-1u; Sun, 01 Oct 2023 17:22:53 -0400 Received: from mail1.systemli.org ([93.190.126.36]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qn3ts-0002yY-02 for kernelnewbies@kernelnewbies.org; Sun, 01 Oct 2023 17:22:52 -0400 Message-ID: <09047692-ef9f-315b-d7e0-9b673815a010@systemli.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemli.org; s=default; t=1696195368; bh=e1B70wi0anU2nX77ZmQ3fLDnmrmwYVcB8ikSeFS4Gfs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=zCbleh05k6+bO4y7Ri1lzqWwEO0tuTHgVQGLVKRD5XyNb9vGf1bZegQUl+UCE9Ogd Az4OaFLVomDJUqICdjT6TnRPoZcQgp4UnU3fJRlWqpa7VIHKUtpeemTqUXbCNoj48G 8e23xuKaGPVfzxkpSJjmRfbmvgDQfCS23ZsP8krA6gw+A3yBe2aBU5IMIuiptJQuPs HI5QzjeeMB4V49kXblZFixYCEg1WXIfrE2PRX3r7TSAhpvyI8QAEJOSNgpKrFp222i eZttjTpj9XABZ1+Qss+xetbWHUGGn66j1YwdJtIjQZfUS8DUTGQo3bNqxWjtIpdGok 4FofRXTsLrB6w== Date: Sun, 1 Oct 2023 23:22:46 +0200 MIME-Version: 1.0 Subject: Re: ktypes vs. devices classes (struct class) Content-Language: en-US To: Greg KH References: <9644b2e3-acaf-c26b-0ec2-9a6c9cb23977@systemli.org> <2023093017-overdraft-umbrella-9ad9@gregkh> <2023100146-storm-unsmooth-d18c@gregkh> <2023100159-tapered-fragment-7f9d@gregkh> From: Richard In-Reply-To: <2023100159-tapered-fragment-7f9d@gregkh> Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kernelnewbies-bounces@kernelnewbies.org >> >>> Is it possible that one device belongs to several classes? >> >> No. > > Oops, well yes. Depends on what you are thinking is a "device" here. > > In the kernel, yes, a 'struct device' on a bus can then register itself > with multiple subsystems that handle different classes, and then > individual 'struct device' are created for those classes that have a > parent of the original 'struct device' on the bus. > > But within a 'struct class', there can only be one "struct device" for > that class for that specific class type (we used to call them "struct > class_device" but that got removed a long time ago as the objects really > all did the same thing.) Oki, thanks for explaining > > It's a bit confusing, yes, sorry, but creating a unified object model of > all devices in the system turns out to be complex due to the huge range > of devices that an operating system needs to manage, which is probably > why most other operating systems have never attempted to do such a > thing. From what I've heard Windows has tried the same with WDF but it's so abstract and elegant it only plays with the "nice" devices so only around 50%, for all other devices you still need the old device model. So in the end every driver developer has to learn both models :D > > When Pat and I created it, we were young and naive and thought "this > should be simple!" Famous last words... :D > > thanks, > > greg k-h Thank you!, Richard _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies