From 5c9408572406c8718a35931ecf74a5cf38632914 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 28 Jan 2019 22:55:39 -0800 Subject: devfs: Drop dev_lseek_default() Only the following cdevs do not declare an .lseek() operation: - Console devices in common/console.c - Firmware framework in common/firmware.c - JTAG driver in drivers/misc/jtag.c - UBI in drivers/mtd/ubi/barebox.c Of those four, first two are marked DEVFS_IS_CHARACTER_DEV and implement only .write() operation and the last two don't implement anything but .ioctl(). While there's probably no meaningful way to use lseek() against any of those devices, there doesn't seem to be any harm in allowing it either. Change devfs_lseek() to ignore absense of .lseek() callback and drop dev_lseek_default() and all references to it in the codebase. Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- drivers/mtd/core.c | 1 - drivers/mtd/mtdoob.c | 1 - drivers/mtd/mtdraw.c | 1 - 3 files changed, 3 deletions(-) (limited to 'drivers/mtd') diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c index f44c6cfc69..881b5f4864 100644 --- a/drivers/mtd/core.c +++ b/drivers/mtd/core.c @@ -462,7 +462,6 @@ static struct cdev_operations mtd_ops = { .protect = mtd_op_protect, #endif .ioctl = mtd_ioctl, - .lseek = dev_lseek_default, }; static int mtd_partition_set(struct param_d *p, void *priv) diff --git a/drivers/mtd/mtdoob.c b/drivers/mtd/mtdoob.c index ffaf9506f3..4aef844485 100644 --- a/drivers/mtd/mtdoob.c +++ b/drivers/mtd/mtdoob.c @@ -66,7 +66,6 @@ static ssize_t mtd_op_read_oob(struct cdev *cdev, void *buf, size_t count, static struct cdev_operations mtd_ops_oob = { .read = mtd_op_read_oob, .ioctl = mtd_ioctl, - .lseek = dev_lseek_default, }; static int add_mtdoob_device(struct mtd_info *mtd, const char *devname, void **priv) diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c index 6e36dc5337..f63da7b3b2 100644 --- a/drivers/mtd/mtdraw.c +++ b/drivers/mtd/mtdraw.c @@ -291,7 +291,6 @@ static const struct cdev_operations mtd_raw_fops = { .read = mtdraw_read, .write = mtdraw_write, .erase = mtdraw_erase, - .lseek = dev_lseek_default, }; static int add_mtdraw_device(struct mtd_info *mtd, const char *devname, void **priv) -- cgit v1.2.3