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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AC23C433DB for ; Tue, 30 Mar 2021 20:09:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5B905619C2 for ; Tue, 30 Mar 2021 20:09:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B905619C2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1lRKfu-0005It-WE; Tue, 30 Mar 2021 16:09:19 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lRKfs-0005Io-U9 for kernelnewbies@kernelnewbies.org; Tue, 30 Mar 2021 16:09:17 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7E857476 for ; Tue, 30 Mar 2021 16:09:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 30 Mar 2021 16:09:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=eIPJqXM7/VFS8pZc3fBzdWrhIPM ZLHHUPap9IPP/Fmk=; b=VzMWwWpWUOYyJMuZ6RtXDx2/oAItlGNmjpowtPfZTmi VtW4yun+NIkHPhLw/uN/zIA1crxguCDWit+IPziZS0TZcDqNgdkpUgsiVPjXzyH9 FtXvvi+7y9bjfhMZYSoSNeGxVUZgVlrSY0DUgH4r8/tUpP53VCiwOhf2xzuLvVcu 8xs/LnUY2fpHDESQ022hZxMDEOxAaJTaHZBCaSxvjsQNqqlI//gqCG5yaTEUdj5N g59fYWvrY1M7676On3aLUpO8rIy2C0gTcNNOKGU9CApgQbO5KaVjSaYgLUUSoeVK NGlW7arwUAKtJ2WG2V//a2nGFT3V+vys23qaeYcgxuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=eIPJqX M7/VFS8pZc3fBzdWrhIPMZLHHUPap9IPP/Fmk=; b=onb/9z73zBZxk5nevBsrKY XsqucKLEq21dtkeD2OPc95/WLGL10nh9I5qRY6AlE4S/8cguNjzrgIklUB8FAs6j uLZah3izPxOJ/+kp7qz3af8Zr+bq51XZG78MLUzgW/+pYEBLgdsFZ7OtUxLEZISE 1Z6ghZzyc/uoiwrPtsMOCGe8AuU/6RIIsEoHh2PoXN6vELgmoljpPYPyaB/4f9Is N0EpYiDk1at13+kEmsf9jqEHq32yPw9R4ZhuE6snrfL5ehda02S+ylqFOLJvoY3j 3elp3VpN7Umf6lQExGxmczJbQprmJ1rH598KQPK+GyL9PI8eQ6I3OhqvuTehirgg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeitddgudegiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhm qeenucggtffrrghtthgvrhhnpeevueehjefgfffgiedvudekvdektdelleelgefhleejie eugeegveeuuddukedvteenucfkphepkeefrdekiedrjeegrdeigeenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtg homh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id AFC921080054; Tue, 30 Mar 2021 16:09:12 -0400 (EDT) Date: Tue, 30 Mar 2021 22:09:09 +0200 From: Greg KH To: kernelnewbies@kernelnewbies.org Subject: Re: platform device as parent of a miscdevice Message-ID: References: <20210330160409.upnyaoyhbu4lll7b@viti.kaiser.cx> <20210330192717.aua2loxmypqoehsp@viti.kaiser.cx> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210330192717.aua2loxmypqoehsp@viti.kaiser.cx> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Tue, Mar 30, 2021 at 09:27:17PM +0200, Martin Kaiser wrote: > > What in-kernel misc drivers do not do that that you feel should? > > My misunderstanding was that quite a few drivers set the parent pointer > but hardly anyone uses the parent pointer in the file_operations. What parent pointer in struct file_operations? I don't see one... > It seems that most drivers have their miscdevice as part of their global > structure and use container_of in the file_operations, e.g. ipmb_read in > drivers/char/ipmi/ipmb_dev_int.c. That's one way to use it, there are I think at least 3 ways to use it, maybe more... Don't confuse the struct device parent pointer with the private pointer to get back to your local device-specific data. They are different things. thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies