Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1049561rdb; Sat, 7 Oct 2023 09:32:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2suQJXw4yBxmtYTDfk8ghVc1m14V+SZm2W8iXBljpVcgLaZoMDHinjx+f469tMKh+0Kee X-Received: by 2002:a05:6a20:4422:b0:16b:d137:dfb3 with SMTP id ce34-20020a056a20442200b0016bd137dfb3mr5879568pzb.59.1696696321753; Sat, 07 Oct 2023 09:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696696321; cv=none; d=google.com; s=arc-20160816; b=o6VsZGweIoD3AFyDhx8Mf98tvQBXQXuYxAm2LkbS/HCqwZvV8DCva6iwOFDOByFgbF rVHNuOo9zsFyrw8xM6Q++IFirTeVeOJCvMhNUDZvFjezAk2ShLchb2/U6nBONOxEOrvT PPwd10otNjx5TecU/qXzRpJhD564HdNVydsI201Plw934JArUJjOtnFLBY7g4y39Mos0 QsQMbhjK6zLgF6Gy22DnnuEeyWvKNEmKMNY7fjt7cV7kyIwuFtK1giz2ya2+lOFCp32F TiS2hCBqpJL1oFeoQ1t/4eOFgfC1xCwfwQ2VlPYb6x75Hpkqa9NACJu4hm3zX6ndUBFi Zjsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=M2+CO4SmxpxGHjK6ASL4J9h77jcGfcNdUXl7Vug8Vyk=; fh=VhOMEsarmZzSHhXIQ5E62L5q5FZshQwhEnR5OhMVqzc=; b=zpTfORBMu4N2AdlDvonCLvGTLZJPzZpMUOUSXSOzC006IYOQ1AXhgzn+2Bgvyi8C6j TjVdnv2UspV6QEMTH4NX9euiGieGPqSSvc54WdZZq+/UYMOhUWBCVzjrhiI2yNYsUCXl a07m3cAxbeVL5+GCN/MjKA4GOqcF6/aFHqizpAAN7uCgQhFZLohbAUObPf+XiadHGsRO 0Rc8CJLW2FlA2vn4vuYZanHAtwbEX0s51o64njFewTgPvfgsn09082fRsdyPY9CO84IL SLlJWyWcldGm9r+y2alc7utLXAAyQjJedVMhZEKl96XWi+wtAJ7exu+CyRE4VfytOFe0 t0cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CLLJanpr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s8-20020a637708000000b00578cc8d2599si6040897pgc.211.2023.10.07.09.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 09:32:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CLLJanpr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C4A35809B761; Sat, 7 Oct 2023 09:31:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344046AbjJGQbK (ORCPT + 99 others); Sat, 7 Oct 2023 12:31:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343956AbjJGQbI (ORCPT ); Sat, 7 Oct 2023 12:31:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AA27B9 for ; Sat, 7 Oct 2023 09:31:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B749C433C8; Sat, 7 Oct 2023 16:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696696263; bh=3saiFoFOXsJSmnhZLFioUhijfK07a5KjkQ16Shr0Tlo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CLLJanprTG5mz641FdNC0EgNnkUfxQ5ZBC7WolVoMeEvuzESgZ9Lp+LKOhHG/8BRT 50XNsXr2kyUJK+WOXAznr1k/j7UCYQSieAeq54JUprx3fCwtBff51vPfQsQ35DqtEv yrD7qzPSVXkNCuJqkdoFhDSyqeFX/12WzrKVRYh0= Date: Sat, 7 Oct 2023 18:31:00 +0200 From: Greg Kroah-Hartman To: Miquel Raynal Cc: Srinivas Kandagatla , Michael Walle , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Marko , Thomas Petazzoni , Luka Perkov , Randy Dunlap , Chen-Yu Tsai , Daniel Golle Subject: Re: [PATCH v12 5/7] nvmem: core: Rework layouts to become regular devices Message-ID: <2023100722-stallion-unquote-a3b1@gregkh> References: <20231005155907.2701706-1-miquel.raynal@bootlin.com> <20231005155907.2701706-6-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231005155907.2701706-6-miquel.raynal@bootlin.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 07 Oct 2023 09:31:18 -0700 (PDT) X-Spam-Level: ** On Thu, Oct 05, 2023 at 05:59:05PM +0200, Miquel Raynal wrote: > --- a/drivers/nvmem/internals.h > +++ b/drivers/nvmem/internals.h > @@ -28,8 +28,30 @@ struct nvmem_device { > nvmem_reg_read_t reg_read; > nvmem_reg_write_t reg_write; > struct gpio_desc *wp_gpio; > + struct device *layout_dev; > struct nvmem_layout *layout; > void *priv; > }; Wait, is this now 2 struct device in the same structure? Which one is the "real" owner of this structure? Why is a pointer to layout_dev needed here as a "struct device" and not a real "struct nvmem_layout_device" or whatever it's called? > struct nvmem_layout { > - const char *name; > - const struct of_device_id *of_match_table; > + struct device *dev; Shouldn't this be a "real" struct device and not just a pointer? If not, what does this point to? Who owns the reference to it? thanks, greg k-h