Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6959991rwp; Tue, 18 Jul 2023 08:07:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXEbdARO5+8haOSqd76LbxPdN7mnqiQG5X2USksYQMfj8XoqPcH+g3DraXuGJoFOqOXPnJ X-Received: by 2002:a05:651c:96:b0:2b6:eb68:fe76 with SMTP id 22-20020a05651c009600b002b6eb68fe76mr11026474ljq.25.1689692857155; Tue, 18 Jul 2023 08:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689692857; cv=none; d=google.com; s=arc-20160816; b=hRS11B1EM7EPhHkXIa4LsxHoz9IbYXo0kijb9Q0im4Hq8owblH3ZjQXVw/mJG5uaj1 8HUk+4J58rkUdl97PdrugPwaaZFLITEJSauhk3YHbgE2y6IpoxBYvbdbAEYpLD86nRcF tzcWsvwBz5j6rgkgjnwy80whqnXPPyOIeaNEsywDye6KhTrpoFcK7TTtjhxJixmkqbbK 29jO6azKLI04KmagxpsXGJeK5HqLc4+BJnBxVpM/rREae6EyTvSHB8MX0cFUncRLRJqK dTYa22LYBWJFwBrdjJCTqaS7N1UqYHdbZA0dXhTKQdJZOoLOMsla0uRNIJn9lnCVxNOZ fW7w== 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=fSEkUxDbJfVTlxdKPg1yqK3RnT5OSrsdVHkw1MKLoz8=; fh=SMrBBmiTIsIvbOiG3KfNGEa687zQZ2pOHlQqaBrQ6Vo=; b=nHhe4m+8cJAcY4fZcBQNL9r6dQiclGJP9+gge5zKBO8M+em6vUR0QMZIGTag9XV+kV jR/JUf9Hkz6eqnwVGcA1TSM2AKz4H6CYnf0YMOpKMm/Yz9EBLB9Ko3CikJV53Trashkp CdCvf87JecPfqpXSUmpdFjJ+P+kfRb4hprqK+vSBET8jWl9YauIneKqAl1KbQarxcCPE xOS8IbkyoqePkK0YkeWXYDY6D/hlUdFxrjkflktUaC+TAQi2MHoJswAeEIhphQ/yB022 G8Y0+izeJlHfi6fsnFoE4HzH98sj7pXPsjHweA2J6DwW2m2On7n14ClFp98dfJbSbFYS h0Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x0Ti1Slm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kj2-20020a170907764200b009932c4d6c73si1263367ejc.288.2023.07.18.08.07.12; Tue, 18 Jul 2023 08:07:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x0Ti1Slm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233361AbjGROoQ (ORCPT + 99 others); Tue, 18 Jul 2023 10:44:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233322AbjGROoO (ORCPT ); Tue, 18 Jul 2023 10:44:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF051719 for ; Tue, 18 Jul 2023 07:44:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D07C8615FA for ; Tue, 18 Jul 2023 14:44:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C501EC433C7; Tue, 18 Jul 2023 14:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689691452; bh=Dpa0BBJY0usbW6MS1PGwRNsH0/TgQbisQVfWeOxQRoI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=x0Ti1SlmzgnshUF8UNksWpJy8hprTQUEHUkxeCZ8AjWsdN28Wqp8URpMHY0+bKRwD VUPtAQ2a6mPqoEDwxY5AseB5uWCIf8XI6+C4rxPaH8CqeXfpyNj/gtyRBc0HTxPS7+ /D+g/K3JwWAXtOyf5/V64e3/GBrFJjAWil5DzECg= Date: Tue, 18 Jul 2023 16:44:09 +0200 From: Greg Kroah-Hartman To: Daniel Golle Cc: Miquel Raynal , Srinivas Kandagatla , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] nvmem: core: append offset to cell name in sysfs Message-ID: <2023071830-ruby-atop-99e6@gregkh> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 18, 2023 at 02:55:57PM +0100, Daniel Golle wrote: > The device tree node names are not required to be unique. Append the > offset to the name to make cell nodes with identical names become > accessible via sysfs and avoid kernel stackdump caused by > sysfs: cannot create duplicate filename '...' > > Fixes: 757f8b3835c9 ("nvmem: core: Expose cells through sysfs") > Signed-off-by: Daniel Golle > --- > drivers/nvmem/core.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c > index 70e951088826d..90fe9dc30f8ba 100644 > --- a/drivers/nvmem/core.c > +++ b/drivers/nvmem/core.c > @@ -480,7 +480,9 @@ static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem) > /* Initialize each attribute to take the name and size of the cell */ > list_for_each_entry(entry, &nvmem->cells, node) { > sysfs_bin_attr_init(&attrs[i]); > - attrs[i].attr.name = devm_kstrdup(&nvmem->dev, entry->name, GFP_KERNEL); > + attrs[i].attr.name = devm_kasprintf(&nvmem->dev, GFP_KERNEL, > + "%s@%d", entry->name, > + entry->offset); No documenatation update to show the new naming scheme? And again, I don't see that git id in Linus's tree, am I just not up to date properly? thanks, greg k-h