From patchwork Fri Dec 17 12:26:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1569999 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=hiy+KDGI; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=D3YG/RLF; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JFpD84QXcz9t55 for ; Fri, 17 Dec 2021 23:28:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rxsGv7fw3I6zDUgI97hwJCagMc3ugI6CbFi5Sn9I+QQ=; b=hiy+KDGIY1zO+y hVH8QSHiyo8eoRneB3GZ6QUCqjpDOQcKx3gVzXnkrLKvDtb2zFGBrr8d0xdbApwHOPeJ7t8v1lzcX l5I4WSmffIq1gqWsqIrWxi9L+ctB1qhlq7ftOPc+MSDEPi0yyInd0EE4f5dP4+xBJf1I2G8rpPwfA //3t7Q6Y5GYDBfUFY0Q8aZud2Rh5R0zct6O7iqHSLz2sIJ7Mw7UZQ7B5Lg8bGBbAvjMP0+nqSRdbp 4t74oJb3gKXAPYeoGYzYAfAGLV6QviHakMUQcG55ZcESYIh/p6hqyglu89E3oHcNEl3xnhWD3rzlB GSolREqe8D84Schy+qog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myCKf-00A7vy-O4; Fri, 17 Dec 2021 12:27:29 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myCJx-00A7fT-Ea for linux-mtd@lists.infradead.org; Fri, 17 Dec 2021 12:26:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1639744005; x=1671280005; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V5ZR6s8MB7+mpb2lz2QxEhkfyBBpZFRy1C+27uyk7k4=; b=D3YG/RLFXjetWuexsd0Gj84KrYt7yusDD4B9GwNEUQkESkiAnuvHBY2s 376e62O8aAaHuK9C7Tsmt28p+2mm+wwHClHD3HGsP3r5SeKsXOHjnr4OV CmaXIj7UKiOYH09xUbVMrAGFkhMRWvh/dbosYb5sxCiEND+y1ewLFyBxk PaLjqMRtx2Ny0eFgGHwJFk1UBVlEO+1wllVFQJaGCO9OkRNhasFdCB1SF AGxowSnFZrHPertUIQ6HuZlYcOXM/6NbHnOokdFDGzl2LDBtPQdsBaDOH OlUtcgSvGBx1bDhcK93mMVN+Nv/LziupMB+Hylid6+skNjE0iA+WisTj6 g==; IronPort-SDR: vrusUyFqdmu3lle/KGNTDzL8oeCzklp9GWQ4094UuC0+YBvFSLNeYyRXrWKbo9WmtUkBoZ8s/K 9NWUSLvP33Eku8rSvuwVRc+0xY6U/FZhi1mwD1nQIx+AXhANtKQB4XefFF4brFsMSqK024PKii tNOCtXgYWfNtTUSk9ob/8umQsaqcD+NrtaZVGTCbKnMMnMAq/p1ORToDXJOOzC/eKRGfVOIgIk BFN/bdoN/tZPFLSZDun5uAX37sR2l+XtoU92jKYukrUQl/8g1lt4M2JlL6mE77hrd0m1iwiSOI EXO6hgHsxQIGC1e6qq9bP53R X-IronPort-AV: E=Sophos;i="5.88,213,1635231600"; d="scan'208";a="140126600" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Dec 2021 05:26:44 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 17 Dec 2021 05:26:44 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 17 Dec 2021 05:26:41 -0700 From: Tudor Ambarus To: , , , , , CC: , , "Tudor Ambarus" Subject: [PATCH 1/2] mtd: spi-nor: Remove debugfs entries that duplicate sysfs entries Date: Fri, 17 Dec 2021 14:26:35 +0200 Message-ID: <20211217122636.474976-2-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211217122636.474976-1-tudor.ambarus@microchip.com> References: <20211217122636.474976-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_042645_601737_54FEA714 X-CRM114-Status: UNSURE ( 8.34 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: SPI NOR sysfs defines partname and jedec_id device attributes, which duplicate the information from debugfs. Since the sysfs directory structure and the attributes in each directory define an ABI betw [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.154.123 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org SPI NOR sysfs defines partname and jedec_id device attributes, which duplicate the information from debugfs. Since the sysfs directory structure and the attributes in each directory define an ABI between the kernel and user space, thus it can never be removed, remove the debugfs entries so that we don't duplicate the information. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav --- drivers/mtd/spi-nor/core.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 2e21d5ac0e2d..435bd17af0b4 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3126,16 +3126,6 @@ static const struct flash_info *spi_nor_match_id(struct spi_nor *nor, return NULL; } -static void spi_nor_debugfs_init(struct spi_nor *nor, - const struct flash_info *info) -{ - struct mtd_info *mtd = &nor->mtd; - - mtd->dbg.partname = info->name; - mtd->dbg.partid = devm_kasprintf(nor->dev, GFP_KERNEL, "spi-nor:%*phN", - info->id_len, info->id); -} - static const struct flash_info *spi_nor_get_flash_info(struct spi_nor *nor, const char *name) { @@ -3243,8 +3233,6 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, nor->info = info; - spi_nor_debugfs_init(nor, info); - mutex_init(&nor->lock); /* Init flash parameters based on flash_info struct and SFDP */ From patchwork Fri Dec 17 12:26:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1570000 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=UbsZ0Dv/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=ifY5eA6d; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JFpF65K30z9t55 for ; Fri, 17 Dec 2021 23:28:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CZRyyptf35f8mGDY6q2ga797Yut+tfONKMOBJAvQQLY=; b=UbsZ0Dv/GYsb1w +O1ZSVhHQrPG52qotacnmbtJOCaJ571w4rzc4Odp9BtJ6Y94URIS9OcmbIKuRATFypoGw/ouFEUqJ VJfca05htaBulGuMbf75psR6s2JvUmSBvPEX6zmalMt3nw+NlTmjHuaSbU4qnwanM9xDvlD3/twBJ Jal4D4NB2otHaFn0EXbb+fte66fZmTEByKUMIW7cOWja1hG5gDDtc6Hb1aaaN9xT+TIT/iyAtNp0P BA3Ci3WZKKwFR6ufVmFPhB5YeVsVGFyxWk538oQBYOOY9xbNeBQL/xNoMROPgdPwVoTetEiyfSTGr bjzuQGG9MssvBDl49S+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myCLS-00A8BX-8s; Fri, 17 Dec 2021 12:28:18 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myCK3-00A7fT-8h for linux-mtd@lists.infradead.org; Fri, 17 Dec 2021 12:26:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1639744010; x=1671280010; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=o0b6NEaAdzRZp/oj1QR5jmYHPgsawDkmnu8lKNhP8dA=; b=ifY5eA6dVX2Vvqt8Y2RDgIDxF7a8DYdDmGZ3w31/V09uUWuWc1usfq+B 8tioqOGDnMAXIA9idLY58I8wcPSKhM4XaBRCAZFP0Za2b2a9ynqJaArBE d4ZscUzz8DzxXV5Fbj36tXL34nIZ/To/6huBFbYtvUCUCKoAFmywIWIcj Dt9ZQ8JTNyvCRJCoSqRK2tMOSRcKtbuRinI5+hNxVq4acDzWVMYtQFKul bTae2ZrBYuvbyBdc6ZZYDpyG7HpAubHoVkRMreJzxYLWu3p4/3dAP8PNZ hsmv+kuTFSmjaJ1VeTdcnf34gHvL8pR8Ck2neD41ZidvAYuTlG6acJ7Y8 A==; IronPort-SDR: FXsndbt7yXlNiJ4sCLGUWhx1mMiHe7cPP9NtEGIoqGaRmhTM7/L2AAVFoc+5tzYl9BpDrZ0iII z7dv0P6qRQ7zIyDKgDZvoFVwSGcfGkBQB47b5N2INR8JAN24MgwzMO6hLGH9/+tdY7DHop6rCQ uGYS9TiSsvSudvW5CZjt8YZmWcsYX8aKCRuIWVehzLOMqldRqiXB3yEEwo98nMJDQ6BH6U+8/+ WzJSQDlmjda6Rxvhbd14lCaCvNnrkPJT3hjChcgB01rodpc5XjfM8YmN76qbhzPr4Smf0sAXpt 36ykzbXkd7hI4a0LjMbsaRSs X-IronPort-AV: E=Sophos;i="5.88,213,1635231600"; d="scan'208";a="140126610" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Dec 2021 05:26:49 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 17 Dec 2021 05:26:46 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 17 Dec 2021 05:26:44 -0700 From: Tudor Ambarus To: , , , , , CC: , , "Tudor Ambarus" Subject: [PATCH 2/2] mtd: core: Remove partid and partname debugfs files Date: Fri, 17 Dec 2021 14:26:36 +0200 Message-ID: <20211217122636.474976-3-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211217122636.474976-1-tudor.ambarus@microchip.com> References: <20211217122636.474976-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_042651_425254_500ACFAC X-CRM114-Status: GOOD ( 10.76 ) X-Spam-Score: -2.7 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: partid and partname debugfs file are no longer used in mtd, remove dead code. Signed-off-by: Tudor Ambarus --- drivers/mtd/mtdcore.c | 35 + include/linux/mtd/mtd.h | 3 --- 2 files changed, 1 insertion(+), 37 deleti [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.154.123 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org partid and partname debugfs file are no longer used in mtd, remove dead code. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav --- drivers/mtd/mtdcore.c | 35 +---------------------------------- include/linux/mtd/mtd.h | 3 --- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 9186268d361b..1977755fc955 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -336,49 +336,16 @@ static const struct device_type mtd_devtype = { .release = mtd_release, }; -static int mtd_partid_debug_show(struct seq_file *s, void *p) -{ - struct mtd_info *mtd = s->private; - - seq_printf(s, "%s\n", mtd->dbg.partid); - - return 0; -} - -DEFINE_SHOW_ATTRIBUTE(mtd_partid_debug); - -static int mtd_partname_debug_show(struct seq_file *s, void *p) -{ - struct mtd_info *mtd = s->private; - - seq_printf(s, "%s\n", mtd->dbg.partname); - - return 0; -} - -DEFINE_SHOW_ATTRIBUTE(mtd_partname_debug); - static struct dentry *dfs_dir_mtd; static void mtd_debugfs_populate(struct mtd_info *mtd) { - struct mtd_info *master = mtd_get_master(mtd); struct device *dev = &mtd->dev; - struct dentry *root; if (IS_ERR_OR_NULL(dfs_dir_mtd)) return; - root = debugfs_create_dir(dev_name(dev), dfs_dir_mtd); - mtd->dbg.dfs_dir = root; - - if (master->dbg.partid) - debugfs_create_file("partid", 0400, root, master, - &mtd_partid_debug_fops); - - if (master->dbg.partname) - debugfs_create_file("partname", 0400, root, master, - &mtd_partname_debug_fops); + mtd->dbg.dfs_dir = debugfs_create_dir(dev_name(dev), dfs_dir_mtd); } #ifndef CONFIG_MMU diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index f5e7dfc2e4e9..00cb269d0261 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -188,9 +188,6 @@ struct module; /* only needed for owner field in mtd_info */ */ struct mtd_debug_info { struct dentry *dfs_dir; - - const char *partname; - const char *partid; }; /**