Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp880270imu; Fri, 4 Jan 2019 08:50:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN6dEUHU/TUe0OyedP3pWK5KsRbFzDFb33aKmAHZHrPAsrOP2mPI0+s5XuiC4pbUNV6+p8BS X-Received: by 2002:a17:902:6b09:: with SMTP id o9mr51433575plk.208.1546620612865; Fri, 04 Jan 2019 08:50:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546620612; cv=none; d=google.com; s=arc-20160816; b=rRoaotOJnsB7nYzB32OtKqF7005X17hQ3bpZ2RXAC0XqTvvQ3wV9FDaLIa2ZYJGAzn 82N7wehovis1fRvNZynhs+9pqWEisMeh4TQe3pFC1b5dVo5bvoCOyEpSrpft8mpGf2Vm 0hVQmiR+cpENhQWudAwdoTl1NFPjKrO9YZAUEEB5QZa7fRfTe1Yf1Ubgz+PqVEPzR/CF n58TDjoG5vHTHhdRAGKzde3kTCs5DYN7mcTPfLTcF7+oY6o4T01cowl8VA46W+/BCpFj CSQEtvupty4MMuKPY0bc3qs+qQAjISVXGfpn5Y28jQ12AV4r3WuA97T1jzoRpvAK0MSd gLHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=NIFTf3qsFuU4PjDUbNg5waReuI7GVNjKRH2NnJtA0tg=; b=HDnkr44D33xLIkQembu3meFsOnSeYMfRqDSCzDNvekrMzOZo6R+E1UWfJTsZqgey+e EYaA2rbqTyxbejBTmXXMidS1GhiotyCD88pOSUvdbI3GX6nIkur/VwL3AgG4A1nKmjWC WxC9/CKKf73kjKGXrqr6NrKx7vzQZLtnQlsyw5kdo5mUbhHVJ4HO289PgqLod1S1uZxj Z5FJSr++fCnuBQIBnIROcoYieFg1zAsvWiTByFsve8wNr1dZO0qg1T0TDO4xGPb+YW9s 5XX32x1KDpxc72/L//abPAKxN+iystvXNahEGpP2cJgpvRAZVjkDyxXqMCSivMkEu57h vuTQ== 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 i66si12405162pfb.91.2019.01.04.08.49.58; Fri, 04 Jan 2019 08:50:12 -0800 (PST) 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 S1728308AbfADNrq (ORCPT + 99 others); Fri, 4 Jan 2019 08:47:46 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:59342 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726380AbfADNrq (ORCPT ); Fri, 4 Jan 2019 08:47:46 -0500 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x04DfW9t004402; Fri, 4 Jan 2019 14:47:32 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2pp0pm8m79-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 04 Jan 2019 14:47:32 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E445A34; Fri, 4 Jan 2019 13:47:31 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C3BE9530D; Fri, 4 Jan 2019 13:47:31 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 4 Jan 2019 14:47:31 +0100 Received: from localhost (10.129.4.161) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 4 Jan 2019 14:47:31 +0100 From: Fabien Dessenne To: Jassi Brar , Maxime Coquelin , Alexandre Torgue , , , CC: Benjamin Gaignard , Arnaud Pouliquen , Ludovic Barre Subject: [PATCH 1/2] mailbox: mailbox-test: fix debugfs in multi-instances Date: Fri, 4 Jan 2019 14:47:15 +0100 Message-ID: <1546609637-6411-1-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.129.4.161] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-04_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Create one debug entry directory per instance to support the multi instantiation. Signed-off-by: Ludovic Barre Signed-off-by: Fabien Dessenne --- drivers/mailbox/mailbox-test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c index 58bfafc..4e2bfba 100644 --- a/drivers/mailbox/mailbox-test.c +++ b/drivers/mailbox/mailbox-test.c @@ -31,7 +31,6 @@ (MBOX_MAX_MSG_LEN / MBOX_BYTES_PER_LINE)) static bool mbox_data_ready; -static struct dentry *root_debugfs_dir; struct mbox_test_device { struct device *dev; @@ -45,6 +44,7 @@ struct mbox_test_device { spinlock_t lock; wait_queue_head_t waitq; struct fasync_struct *async_queue; + struct dentry *root_debugfs_dir; }; static ssize_t mbox_test_signal_write(struct file *filp, @@ -262,16 +262,16 @@ static int mbox_test_add_debugfs(struct platform_device *pdev, if (!debugfs_initialized()) return 0; - root_debugfs_dir = debugfs_create_dir("mailbox", NULL); - if (!root_debugfs_dir) { + tdev->root_debugfs_dir = debugfs_create_dir(dev_name(&pdev->dev), NULL); + if (!tdev->root_debugfs_dir) { dev_err(&pdev->dev, "Failed to create Mailbox debugfs\n"); return -EINVAL; } - debugfs_create_file("message", 0600, root_debugfs_dir, + debugfs_create_file("message", 0600, tdev->root_debugfs_dir, tdev, &mbox_test_message_ops); - debugfs_create_file("signal", 0200, root_debugfs_dir, + debugfs_create_file("signal", 0200, tdev->root_debugfs_dir, tdev, &mbox_test_signal_ops); return 0; @@ -416,7 +416,7 @@ static int mbox_test_remove(struct platform_device *pdev) { struct mbox_test_device *tdev = platform_get_drvdata(pdev); - debugfs_remove_recursive(root_debugfs_dir); + debugfs_remove_recursive(tdev->root_debugfs_dir); if (tdev->tx_channel) mbox_free_channel(tdev->tx_channel); -- 2.7.4