From patchwork Tue Jan 3 04:54:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Reid X-Patchwork-Id: 9494371 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 12F4960413 for ; Tue, 3 Jan 2017 04:54:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02B3B20246 for ; Tue, 3 Jan 2017 04:54:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E72762679B; Tue, 3 Jan 2017 04:54:19 +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 D853520246 for ; Tue, 3 Jan 2017 04:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933314AbdACEyS (ORCPT ); Mon, 2 Jan 2017 23:54:18 -0500 Received: from 203-59-230-133.perm.iinet.net.au ([203.59.230.133]:47118 "EHLO preid-centos7.electromag.com.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932662AbdACEyR (ORCPT ); Mon, 2 Jan 2017 23:54:17 -0500 Received: by preid-centos7.electromag.com.au (Postfix, from userid 1000) id 83E9D3002EB17; Tue, 3 Jan 2017 12:54:11 +0800 (AWST) From: Phil Reid To: broonie@kernel.org, kernel@mseidel.net, preid@electromag.com.au, linux-spi@vger.kernel.org Subject: [PATCH v2 1/1] spi: dw: Make debugfs name unique between instances Date: Tue, 3 Jan 2017 12:54:09 +0800 Message-Id: <1483419249-88956-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 bus_num to the debugfs dir name to make it unique. Signed-off-by: Phil Reid Reviewed-by: Andy Shevchenko --- Notes: Changes from v1: - Reduce buffer size to 32. - Use bus_num instead of device name. 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..77439ac 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[32]; + + snprintf(name, 32, "dw_spi%d", dws->master->bus_num); + dws->debugfs = debugfs_create_dir(name, NULL); if (!dws->debugfs) return -ENOMEM;