From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 09/14] fs: devfs-core: remove unused code
Date: Fri, 31 Mar 2017 07:33:18 +0200 [thread overview]
Message-ID: <20170331053323.17821-10-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20170331053323.17821-1-s.hauer@pengutronix.de>
Partitions on mtd devices are implemented as mtd devices themselves
which have a ioctl hook. The DEVFS_IS_PARTITION flag is never set
for these devices, so the partition offset translation code in
fs/devfs-core.c is unused. Remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
fs/devfs-core.c | 68 ---------------------------------------------------------
1 file changed, 68 deletions(-)
diff --git a/fs/devfs-core.c b/fs/devfs-core.c
index c51ea6a871..7b3754ed8e 100644
--- a/fs/devfs-core.c
+++ b/fs/devfs-core.c
@@ -184,76 +184,8 @@ int cdev_flush(struct cdev *cdev)
return cdev->ops->flush(cdev);
}
-static int partition_ioctl(struct cdev *cdev, int request, void *buf)
-{
- int ret = 0;
- loff_t offset, *_buf = buf;
- struct mtd_info_user *user = buf;
-
- switch (request) {
- case MEMSETBADBLOCK:
- case MEMSETGOODBLOCK:
- case MEMGETBADBLOCK:
- offset = *_buf;
- offset += cdev->offset;
- ret = cdev->ops->ioctl(cdev, request, &offset);
- break;
- case MEMGETINFO:
- if (cdev->mtd) {
- user->type = cdev->mtd->type;
- user->flags = cdev->mtd->flags;
- user->size = cdev->mtd->size;
- user->erasesize = cdev->mtd->erasesize;
- user->writesize = cdev->mtd->writesize;
- user->oobsize = cdev->mtd->oobsize;
- user->subpagesize = cdev->mtd->writesize >> cdev->mtd->subpage_sft;
- user->mtd = cdev->mtd;
- /* The below fields are obsolete */
- user->ecctype = -1;
- user->eccsize = 0;
- break;
- }
- if (!cdev->ops->ioctl) {
- ret = -EINVAL;
- break;
- }
- ret = cdev->ops->ioctl(cdev, request, buf);
- break;
-#if (defined(CONFIG_NAND_ECC_HW) || defined(CONFIG_NAND_ECC_SOFT))
- case ECCGETSTATS:
-#endif
- case MEMERASE:
- if (!cdev->ops->ioctl) {
- ret = -EINVAL;
- break;
- }
- ret = cdev->ops->ioctl(cdev, request, buf);
- break;
-#ifdef CONFIG_PARTITION
- case MEMGETREGIONINFO:
- if (cdev->mtd) {
- struct region_info_user *reg = buf;
- int erasesize_shift = ffs(cdev->mtd->erasesize) - 1;
-
- reg->offset = cdev->offset;
- reg->erasesize = cdev->mtd->erasesize;
- reg->numblocks = cdev->size >> erasesize_shift;
- reg->regionindex = cdev->mtd->index;
- }
- break;
-#endif
- default:
- ret = -EINVAL;
- }
-
- return ret;
-}
-
int cdev_ioctl(struct cdev *cdev, int request, void *buf)
{
- if (cdev->flags & DEVFS_IS_PARTITION)
- return partition_ioctl(cdev, request, buf);
-
if (!cdev->ops->ioctl)
return -EINVAL;
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2017-03-31 5:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-31 5:33 OF partitions rework Sascha Hauer
2017-03-31 5:33 ` [PATCH 01/14] of: Add of_property_write_string() Sascha Hauer
2017-03-31 5:33 ` [PATCH 02/14] treewide: Use of_property_write_string() where appropriate Sascha Hauer
2017-03-31 5:33 ` [PATCH 03/14] of: partition: Move of_mtd_fixup to drivers/of/ Sascha Hauer
2017-03-31 5:33 ` [PATCH 04/14] mtd: of: Make used partition binding configurable Sascha Hauer
2017-03-31 5:33 ` [PATCH 05/14] of: partition: support 64bit partition sizes Sascha Hauer
2017-03-31 5:33 ` [PATCH 06/14] mtd: partition: set cdev->offset to the actual offset Sascha Hauer
2017-03-31 8:46 ` Sascha Hauer
2017-03-31 5:33 ` [PATCH 07/14] cdev: Collect partitions on list Sascha Hauer
2017-03-31 5:33 ` [PATCH 08/14] of: partition: Make partition fixup independent from mtd devices Sascha Hauer
2017-03-31 5:33 ` Sascha Hauer [this message]
2017-03-31 5:33 ` [PATCH 10/14] fs: devfs-core: replace DEVFS_PARTITION_FIXED flag with pointer to the master cdev Sascha Hauer
2017-03-31 5:33 ` [PATCH 11/14] of: partition: only create partition node when partitions exist Sascha Hauer
2017-03-31 5:33 ` [PATCH 12/14] of: partitions: flag partitions from a partition table Sascha Hauer
2017-03-31 5:33 ` [PATCH 13/14] of: partition: Register the of partition fixup for of partition users Sascha Hauer
2017-03-31 5:33 ` [PATCH 14/14] of: of_path: add of_find_node_by_devpath() Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170331053323.17821-10-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox