From patchwork Thu Dec 22 09:18:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Reid X-Patchwork-Id: 9487025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 36FB662AAB for ; Fri, 23 Dec 2016 01:13:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A27E27F8C for ; Fri, 23 Dec 2016 01:13:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EEB327FA6; Fri, 23 Dec 2016 01:13:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7316A27F8C for ; Fri, 23 Dec 2016 01:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030356AbcLWBM4 (ORCPT ); Thu, 22 Dec 2016 20:12:56 -0500 Received: from 203-59-230-133.perm.iinet.net.au ([203.59.230.133]:62322 "EHLO preid-centos7.electromag.com.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030341AbcLWBMz (ORCPT ); Thu, 22 Dec 2016 20:12:55 -0500 X-Greylist: delayed 57272 seconds by postgrey-1.27 at vger.kernel.org; Thu, 22 Dec 2016 20:12:55 EST Received: by preid-centos7.electromag.com.au (Postfix, from userid 1000) id 61B7E30000659; Thu, 22 Dec 2016 17:18:16 +0800 (AWST) From: Phil Reid To: broonie@kernel.org, kernel@mseidel.net, jszhang@marvell.com, preid@electromag.com.au, linux-spi@vger.kernel.org Subject: [PATCH 1/1] spi: dw: Make debugfs name unique between instances Date: Thu, 22 Dec 2016 17:18:12 +0800 Message-Id: <1482398292-46946-1-git-send-email-preid@electromag.com.au> X-Mailer: git-send-email 1.8.3.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some system have multiple dw devices. Currently the driver uses a fixed name for the debugfs dir. Append dev name to the debugfs dir name to make it unique. Signed-off-by: Phil Reid --- drivers/spi/spi-dw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 27960e4..c4226c0 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -107,7 +107,10 @@ static ssize_t dw_spi_show_regs(struct file *file, char __user *user_buf, static int dw_spi_debugfs_init(struct dw_spi *dws) { - dws->debugfs = debugfs_create_dir("dw_spi", NULL); + char name[128]; + + snprintf(name, 128, "dw_spi-%s", dev_name(&dws->master->dev)); + dws->debugfs = debugfs_create_dir(name, NULL); if (!dws->debugfs) return -ENOMEM;