Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp723351ybm; Tue, 21 May 2019 02:23:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqz63/eK5OiZtRlXAxt+xWpMradxlxEXlPaHodC4o8WD+hAzHTk78aGpGdf+jxgbjUarvp41 X-Received: by 2002:a17:902:8c85:: with SMTP id t5mr81451183plo.23.1558430632259; Tue, 21 May 2019 02:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558430632; cv=none; d=google.com; s=arc-20160816; b=jqIeBQoYowdM5yGhB8jk2HRK2Np+kal1DQAeYltNAsPkEDiNbCfOaq1AxpNlJNJ0F6 VjJ89/ypgBYI6MT1w2FkIwMj4jYOFDXneKWXxEHYSKOwrfjnzMRCU8/5boWOH7BCuGCF LuW3Fzb6b5QhuDSPVxTwko6Op+JoU3t7x3KPIDc0Okgu0t3Koy+1JWaz7rTiB1cxsC2J ns2YDv25PoUAVLKn8B8bcGuxjVdson8bOFKcyuPxszHLaTU/v+BEEOAvU6MGKdsydktG itteqzo7EX0BbNiCWPgNPnwsoPwWl93scWuumTR6ged7mNulqp5nIWD5rrHgygeCGZmn Cb0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=SZ0cxR7ThVuhjR5pN6okXCTTCqsX+ndbbfZ2D/p7c54=; b=MWNeigOuX3UILNsKgRiTxJKfjvodyRdhlG/eHK8P8bC9OFStD5d2SQoWgQDM1Q3BaX fMEAUnKDIKW1wfvHaCUC29W4h6oyNkEiukod0TaNd8R3pehjfJYv5aA4iC32FULnSSPb 5sJO6fCHhFBSwt9blbwwOiOInm4jscZqCNw5Xbt9lhlzZyCMcl4f0YLyjSn73nRgxHlG hsTVhWlOoPXT+tLty5r/wdowXV4Ftm1p6MIrjxs9xQDTBL22Tob2+simJ5WrIMDCLKXN lutk2FqDIQ+IkkCv2D8mu5vpGYV1QYqJAvsCCOrY2QR0SsfKQhwT8EphbNF9kNs/F+lT ii7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o33si22053662plb.230.2019.05.21.02.23.37; Tue, 21 May 2019 02:23:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbfEUJVJ (ORCPT + 99 others); Tue, 21 May 2019 05:21:09 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:51169 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbfEUJVJ (ORCPT ); Tue, 21 May 2019 05:21:09 -0400 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hT0xH-00004w-P8; Tue, 21 May 2019 11:21:07 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1hT0xH-0002Ya-4r; Tue, 21 May 2019 11:21:07 +0200 Date: Tue, 21 May 2019 11:21:07 +0200 From: Sascha Hauer To: Srinivas Kandagatla Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-mtd@lists.infradead.org Subject: Re: nvmem creates multiple devices with the same name Message-ID: <20190521092107.zpdkkhaanzruhqui@pengutronix.de> References: <20190521085641.i6g5aijwa5zbolah@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 11:11:48 up 3 days, 15:30, 49 users, load average: 0.10, 0.18, 0.16 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 21, 2019 at 10:02:32AM +0100, Srinivas Kandagatla wrote: > > > On 21/05/2019 09:56, Sascha Hauer wrote: > > . Are there any suggestions how to register the nvmem devices > > with a different name? > > struct nvmem_config provides id field for this purpose, this will be used by > nvmem to set the device name space along with name field. There's no way for a caller to know a unique name/id combination. The mtd layer could initialize the id field with the mtd number, but that would still not guarantee that another caller, like an EEPROM driver or such, doesn't use the same name/id combination. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |