Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1017486rwn; Thu, 8 Sep 2022 12:03:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7w2+UNsaS2bd3NTsADZ27sUJ5g+ZPcOd2a0gGNMpvW05yZwKVsK8PeNSihqttw5kmNj0xn X-Received: by 2002:a17:903:32c2:b0:176:acdf:e86b with SMTP id i2-20020a17090332c200b00176acdfe86bmr10302029plr.54.1662663826495; Thu, 08 Sep 2022 12:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662663826; cv=none; d=google.com; s=arc-20160816; b=s8obJaOJBmaqfCPICZeJtTHKYCpZ/OwH9/qnWb659ALFyM51z6Af9ELWDQsxuJfXdU MjQLlAbb3kxOcEUnb7EHP3EcrK8hdR2RypOEhfUZlPPWy4UBcvmgcSZwWCUYVqpvZVZa JLVESdiw4PH6tlIiXz3ajexuV/Qc4RvH3lbTxboB+mwDET/O4qUk6M1vAsArT6T5qIGb 9vd6QFCT2ImLt6wP7ew8b4+KPYPBsFcbJAs+uZS9nMK0titWbLAAFoNExuo4Dm4+EZql pMfCIcB56sY7NaiLAuUV29Ya8ZUpvVUqyZEGb4leh1tfpV3fVX18oWb0fCwEjk1HrJAG 1pnA== 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:sender:dkim-signature; bh=tJTwU4stupW8LHT+ZyN0zQCc5o/+KAr70ucKLAwyn7k=; b=WHLQ/wXcC9YjSMsxxYeRT1fRKDq9iGYQ+y5nDCmM2mI3ShLwohNNBSSwC/wbeBYLha 1jCG03yOsOAwPLqpHAjYjXcGqm6lCTR0Qb4h+GVNE0Bcw5h2MDgJkc8aA9gTDNWKk8cj pmz1GQx24Lnv5BwB5VvLSawa29HBTZS3Etar1FPT2h2UCT2R1GJwMJwgOiQvO3MDBZoz MqmQziV4L8o08pMsi9ti6RRPKdnKM/AIuEpYK5BOVmGOJ+Le0lVpp8AUnLRH4PTAAHGq jQrECLLlJLxM4BL9h89CN4saAvXjF2xEDZIm54o/676jZ8gHQG/f8KugYSHtFae1gRR1 tIGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TzysSwcb; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s2-20020aa78bc2000000b00540d7c20889si336736pfd.8.2022.09.08.12.03.31; Thu, 08 Sep 2022 12:03:46 -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=@gmail.com header.s=20210112 header.b=TzysSwcb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232241AbiIHSuD (ORCPT + 99 others); Thu, 8 Sep 2022 14:50:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232405AbiIHSt4 (ORCPT ); Thu, 8 Sep 2022 14:49:56 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A2898C03C; Thu, 8 Sep 2022 11:49:53 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id s206so17601727pgs.3; Thu, 08 Sep 2022 11:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date; bh=tJTwU4stupW8LHT+ZyN0zQCc5o/+KAr70ucKLAwyn7k=; b=TzysSwcbkYenIlokh8kQco3QIGs7ps1wA9TKybuAyhI+dWuEiy/p8plwELhN9NEkMo gVOVnRThI+UjBo7Nel93fHX3ew1chrv2UijXR83IuWUipXoNzVi8uTRm0bmlMXkPpocd b5MMzbCARCWWspXUkwKp81mcgiUyxJ/ZLFJYuypiT7xHX80BJsjK0/rCZ0TdAwNot0S4 MgpdkNKvXF/PpDCflsgq4+o9WKPW6bhIIJOZdzIpNJld9kqY0IDZ+ZUjjzEUI5BET/M+ ua/GDG1orPPCYK6vixsUMQYDvZ8WSh9NWiV/b+Zca41gzj6TpVDkNZw4syJeyZvJr7ZE FDRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date; bh=tJTwU4stupW8LHT+ZyN0zQCc5o/+KAr70ucKLAwyn7k=; b=4F+x2ADRCLFdM2nHMHipLy4WF09Uc/aRhn2E5LW34Wa2cu8V2EZmvWXdTe1Q+koAfU K0vsRF69saSeTYeRbbpUI0TNN3XW74BETsVYCPSerN39sITFyhjs8ivNWczpbgf2LrJX cDjnKUDGlxG/Gj4TTZbIxxSDhs+6HgKxkqtIXEzMqcDv0isZS+/JJjcfLmIdiNjVO3qK wXoK6gdmZQ2cyMW5ny+XJYDARa5GHufahGsPb964PqDFc9qKRAuqkemakrdsIy3uTUDn o9acJkAt/7Mu3ZB8lH9ryOYWc6tI1M7hI3Bms80mjRD2VJDzfzS/nJQzFrbdXkVEi7Rd D0hQ== X-Gm-Message-State: ACgBeo26dMbkPqVtlU9/JCQ0JbDlI7Vo/ZJVdvHckV3fpQmClZcVVi6S ATQkA8//p8L8IoS64TBsH4yRIvit1eyVhA== X-Received: by 2002:a05:6a00:21c8:b0:52e:3404:eba5 with SMTP id t8-20020a056a0021c800b0052e3404eba5mr10435950pfj.67.1662662991469; Thu, 08 Sep 2022 11:49:51 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id nd15-20020a17090b4ccf00b002006f8e7688sm2117124pjb.32.2022.09.08.11.49.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 11:49:50 -0700 (PDT) Sender: Guenter Roeck Date: Thu, 8 Sep 2022 11:49:49 -0700 From: Guenter Roeck To: Alexandru Gagniuc Cc: linux-hwmon@vger.kernel.org, robert.marko@sartura.hr, luka.perkov@sartura.hr, jdelvare@suse.com, dev@aboehler.at, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] hwmon: (tps23861) create unique debugfs directory per device Message-ID: <20220908184949.GA3191400@roeck-us.net> References: <20220907015405.16547-1-mr.nuke.me@gmail.com> <20220907015405.16547-2-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220907015405.16547-2-mr.nuke.me@gmail.com> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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, Sep 06, 2022 at 08:54:05PM -0500, Alexandru Gagniuc wrote: > On systems with more than one tps23861, creating the debugfs directory > for additional devices fails with > > debugfs: Directory 'tps23861' with parent '/' already present! > > To resolve this, include the hwmon device name in the directory name. > Since the name is unique, this guarantees that the debugfs directory > is unique. > > Signed-off-by: Alexandru Gagniuc > Reviewed-by: Guenter Roeck Applied to hwmon-next. Thanks, Guenter > --- > drivers/hwmon/tps23861.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/drivers/hwmon/tps23861.c b/drivers/hwmon/tps23861.c > index 019009b71a90..a3d7d6b75a26 100644 > --- a/drivers/hwmon/tps23861.c > +++ b/drivers/hwmon/tps23861.c > @@ -503,9 +503,17 @@ static int tps23861_port_status_show(struct seq_file *s, void *data) > > DEFINE_SHOW_ATTRIBUTE(tps23861_port_status); > > -static void tps23861_init_debugfs(struct tps23861_data *data) > +static void tps23861_init_debugfs(struct tps23861_data *data, > + struct device *hwmon_dev) > { > - data->debugfs_dir = debugfs_create_dir(data->client->name, NULL); > + const char *debugfs_name; > + > + debugfs_name = devm_kasprintf(&data->client->dev, GFP_KERNEL, "%s-%s", > + data->client->name, dev_name(hwmon_dev)); > + if (!debugfs_name) > + return; > + > + data->debugfs_dir = debugfs_create_dir(debugfs_name, NULL); > > debugfs_create_file("port_status", > 0400, > @@ -554,7 +562,7 @@ static int tps23861_probe(struct i2c_client *client) > if (IS_ERR(hwmon_dev)) > return PTR_ERR(hwmon_dev); > > - tps23861_init_debugfs(data); > + tps23861_init_debugfs(data, hwmon_dev); > > return 0; > }