Skip to content

Commit

Permalink
rename file_operations -> cdev_operations
Browse files Browse the repository at this point in the history
Linux also has struct file_operations which are something different.
Rename our file_operations to cdev_operations which better matches
what we have.

Signed-off-by: Sascha Hauer <[email protected]>
  • Loading branch information
saschahauer committed Apr 6, 2018
1 parent bd9ad3a commit 311282b
Show file tree
Hide file tree
Showing 34 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-mxs/ocotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static ssize_t mxs_ocotp_cdev_write(struct cdev *cdev, const void *buf, size_t c
return ret;
}

static struct file_operations mxs_ocotp_ops = {
static struct cdev_operations mxs_ocotp_ops = {
.read = mxs_ocotp_cdev_read,
.lseek = dev_lseek_default,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/sandbox/board/hostfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void hf_info(struct device_d *dev)
printf("file: %s\n", priv->filename);
}

static struct file_operations hf_fops = {
static struct cdev_operations hf_fops = {
.read = hf_read,
.write = hf_write,
.lseek = dev_lseek_default,
Expand Down
2 changes: 1 addition & 1 deletion commands/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
return 0;
}

static struct file_operations memops = {
static struct cdev_operations memops = {
.read = mem_read,
.write = mem_write,
.memmap = generic_memmap_rw,
Expand Down
8 changes: 4 additions & 4 deletions commands/stddev.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static ssize_t zero_read(struct cdev *cdev, void *buf, size_t count, loff_t offs
return count;
}

static struct file_operations zeroops = {
static struct cdev_operations zeroops = {
.read = zero_read,
.lseek = dev_lseek_default,
};
Expand Down Expand Up @@ -53,7 +53,7 @@ static ssize_t full_read(struct cdev *cdev, void *buf, size_t count, loff_t offs
return count;
}

static struct file_operations fullops = {
static struct cdev_operations fullops = {
.read = full_read,
.lseek = dev_lseek_default,
};
Expand All @@ -80,7 +80,7 @@ static ssize_t null_write(struct cdev *cdev, const void *buf, size_t count, loff
return count;
}

static struct file_operations nullops = {
static struct cdev_operations nullops = {
.write = null_write,
.lseek = dev_lseek_default,
};
Expand Down Expand Up @@ -108,7 +108,7 @@ static ssize_t prng_read(struct cdev *cdev, void *buf, size_t count, loff_t offs
return count;
}

static struct file_operations prngops = {
static struct cdev_operations prngops = {
.read = prng_read,
.lseek = dev_lseek_default,
};
Expand Down
2 changes: 1 addition & 1 deletion common/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static int block_op_flush(struct cdev *cdev)
return writebuffer_flush(blk);
}

static struct file_operations block_ops = {
static struct cdev_operations block_ops = {
.read = block_op_read,
#ifdef CONFIG_BLOCK_WRITE
.write = block_op_write,
Expand Down
2 changes: 1 addition & 1 deletion common/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static int firmware_close(struct cdev *cdev)
return 0;
}

static struct file_operations firmware_ops = {
static struct cdev_operations firmware_ops = {
.open = firmware_open,
.write = firmware_write,
.close = firmware_close,
Expand Down
2 changes: 1 addition & 1 deletion drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static ssize_t regmap_cdev_write(struct cdev *cdev, const void *buf, size_t coun
return count;
}

static struct file_operations regmap_fops = {
static struct cdev_operations regmap_fops = {
.lseek = dev_lseek_default,
.read = regmap_cdev_read,
.write = regmap_cdev_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/eeprom/at24.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct at24_data {
struct at24_platform_data chip;

struct cdev cdev;
struct file_operations fops;
struct cdev_operations fops;

u8 *writebuf;
unsigned write_max;
Expand Down
2 changes: 1 addition & 1 deletion drivers/eeprom/at25.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static ssize_t at25_ee_write(struct cdev *cdev,
return written ? written : status;
}

static struct file_operations at25_fops = {
static struct cdev_operations at25_fops = {
.read = at25_ee_read,
.write = at25_ee_write,
.lseek = dev_lseek_default,
Expand Down
2 changes: 1 addition & 1 deletion drivers/hw_random/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static ssize_t rng_dev_read(struct cdev *cdev, void *buf, size_t size,
return cur;
}

static struct file_operations rng_chrdev_ops = {
static struct cdev_operations rng_chrdev_ops = {
.read = rng_dev_read,
.lseek = dev_lseek_default,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/act8846.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static ssize_t act8846_write(struct cdev *cdev, const void *_buf, size_t count,
return count;
}

static struct file_operations act8846_fops = {
static struct cdev_operations act8846_fops = {
.lseek = dev_lseek_default,
.read = act8846_read,
.write = act8846_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/lp3972.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static ssize_t lp_read(struct cdev *cdev, void *_buf, size_t count, loff_t offse
return count;
}

static struct file_operations lp_fops = {
static struct cdev_operations lp_fops = {
.lseek = dev_lseek_default,
.read = lp_read,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/mc34704.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static ssize_t mc34704_write(struct cdev *cdev, const void *_buf, size_t count,
return count;
}

static struct file_operations mc34704_fops = {
static struct cdev_operations mc34704_fops = {
.lseek = dev_lseek_default,
.read = mc34704_read,
.write = mc34704_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/mc9sdz60.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static ssize_t mc_write(struct cdev *cdev, const void *_buf, size_t count, loff_
return count;
}

static struct file_operations mc_fops = {
static struct cdev_operations mc_fops = {
.lseek = dev_lseek_default,
.read = mc_read,
.write = mc_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/stmpe-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static ssize_t stmpe_write(struct cdev *cdev, const void *_buf, size_t count, lo
return count;
}

static struct file_operations stmpe_fops = {
static struct cdev_operations stmpe_fops = {
.lseek = dev_lseek_default,
.read = stmpe_read,
.write = stmpe_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/twl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static ssize_t twl_write(struct cdev *cdev, const void *_buf, size_t count,
return count;
}

struct file_operations twl_fops = {
struct cdev_operations twl_fops = {
.lseek = dev_lseek_default,
.read = twl_read,
.write = twl_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/jtag.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static int jtag_ioctl(struct cdev *inode, int cmd, void *arg)
return ret;
}

static struct file_operations jtag_operations = {
static struct cdev_operations jtag_operations = {
.ioctl = jtag_ioctl,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct sram {
struct cdev cdev;
};

static struct file_operations memops = {
static struct cdev_operations memops = {
.read = mem_read,
.write = mem_write,
.memmap = generic_memmap_rw,
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops)
return ret_code >= mtd->bitflip_threshold ? -EUCLEAN : 0;
}

static struct file_operations mtd_ops = {
static struct cdev_operations mtd_ops = {
.read = mtd_op_read,
#ifdef CONFIG_MTD_WRITE
.write = mtd_op_write,
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/mtdoob.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static ssize_t mtd_op_read_oob(struct cdev *cdev, void *buf, size_t count,
return mtd->oobsize;
}

static struct file_operations mtd_ops_oob = {
static struct cdev_operations mtd_ops_oob = {
.read = mtd_op_read_oob,
.ioctl = mtd_ioctl,
.lseek = dev_lseek_default,
Expand Down
4 changes: 2 additions & 2 deletions drivers/mtd/mtdraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static ssize_t mtdraw_erase(struct cdev *cdev, loff_t count, loff_t offset)
}
#endif

static const struct file_operations mtd_raw_fops = {
static const struct cdev_operations mtd_raw_fops = {
.read = mtdraw_read,
.write = mtdraw_write,
.erase = mtdraw_erase,
Expand All @@ -305,7 +305,7 @@ static int add_mtdraw_device(struct mtd_info *mtd, const char *devname, void **p
mtdraw->writebuf = xmalloc(RAW_WRITEBUF_SIZE);
mtdraw->mtd = mtd;

mtdraw->cdev.ops = (struct file_operations *)&mtd_raw_fops;
mtdraw->cdev.ops = (struct cdev_operations *)&mtd_raw_fops;
mtdraw->cdev.size = mtd_div_by_wb(mtd->size, mtd) *
(mtd->writesize + mtd->oobsize);
mtdraw->cdev.name = basprintf("%s.raw", mtd->cdev.name);
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/nand/nand-bb.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static loff_t nand_bb_lseek(struct cdev *cdev, loff_t __offset)
return -EINVAL;
}

static struct file_operations nand_bb_ops = {
static struct cdev_operations nand_bb_ops = {
.open = nand_bb_open,
.close = nand_bb_close,
.read = nand_bb_read,
Expand Down
4 changes: 2 additions & 2 deletions drivers/mtd/ubi/barebox.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static int ubi_volume_cdev_ioctl(struct cdev *cdev, int cmd, void *buf)
return err;
}

static struct file_operations ubi_volume_fops = {
static struct cdev_operations ubi_volume_fops = {
.open = ubi_volume_cdev_open,
.close = ubi_volume_cdev_close,
.read = ubi_volume_cdev_read,
Expand Down Expand Up @@ -467,7 +467,7 @@ static int ubi_cdev_ioctl(struct cdev *cdev, int cmd, void *buf)
return 0;
}

static struct file_operations ubi_fops = {
static struct cdev_operations ubi_fops = {
.ioctl = ubi_cdev_ioctl,
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/e1000/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ static ssize_t e1000_invm_cdev_write(struct cdev *cdev, const void *buf,
return ret;
}

static struct file_operations e1000_invm_ops = {
static struct cdev_operations e1000_invm_ops = {
.read = e1000_invm_cdev_read,
.write = e1000_invm_cdev_write,
.lseek = dev_lseek_default,
Expand All @@ -1320,7 +1320,7 @@ static ssize_t e1000_eeprom_cdev_read(struct cdev *cdev, void *buf,
return (count / 2) * 2;
};

static struct file_operations e1000_eeprom_ops = {
static struct cdev_operations e1000_eeprom_ops = {
.read = e1000_eeprom_cdev_read,
.lseek = dev_lseek_default,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ksz8864rmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static ssize_t micel_switch_write(struct cdev *cdev, const void *_buf, size_t co
return count;
}

static struct file_operations micrel_switch_ops = {
static struct cdev_operations micrel_switch_ops = {
.read = micel_switch_read,
.write = micel_switch_write,
.lseek = dev_lseek_default,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static ssize_t phydev_write(struct cdev *cdev, const void *_buf, size_t count, l
return count;
}

static struct file_operations phydev_ops = {
static struct cdev_operations phydev_ops = {
.read = phydev_read,
.write = phydev_write,
.lseek = dev_lseek_default,
Expand Down
2 changes: 1 addition & 1 deletion drivers/nvmem/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static ssize_t nvmem_cdev_write(struct cdev *cdev, const void *buf, size_t count
return retlen;
}

static struct file_operations nvmem_chrdev_ops = {
static struct cdev_operations nvmem_chrdev_ops = {
.read = nvmem_cdev_read,
.write = nvmem_cdev_write,
.lseek = dev_lseek_default,
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static int fb_set_modename(struct param_d *param, void *priv)
return 0;
}

static struct file_operations fb_ops = {
static struct cdev_operations fb_ops = {
.read = mem_read,
.write = mem_write,
.memmap = generic_memmap_rw,
Expand Down
2 changes: 1 addition & 1 deletion drivers/w1/slaves/w1_ds2431.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static ssize_t ds2431_cdev_write(struct cdev *cdev, const void *buf, size_t coun
#define ds2431_cdev_write NULL
#endif

static struct file_operations ds2431_ops = {
static struct cdev_operations ds2431_ops = {
.read = ds2431_cdev_read,
.write = ds2431_cdev_write,
.lseek = dev_lseek_default,
Expand Down
2 changes: 1 addition & 1 deletion drivers/w1/slaves/w1_ds2433.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static ssize_t ds2433_cdev_write(struct cdev *cdev, const void *buf, size_t coun
#define ds2433_cdev_write NULL
#endif

static struct file_operations ds2433_ops = {
static struct cdev_operations ds2433_ops = {
.read = ds2433_cdev_read,
.write = ds2433_cdev_write,
.lseek = dev_lseek_default,
Expand Down
2 changes: 1 addition & 1 deletion fs/devfs-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static ssize_t loop_write(struct cdev *cdev, const void *buf, size_t count,
return write(priv->fd, buf, count);
}

static const struct file_operations loop_ops = {
static const struct cdev_operations loop_ops = {
.read = loop_read,
.write = loop_write,
.memmap = generic_memmap_rw,
Expand Down
2 changes: 1 addition & 1 deletion include/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct console_device {
const char *linux_console_name;

struct cdev devfs;
struct file_operations fops;
struct cdev_operations fops;
};

int console_register(struct console_device *cdev);
Expand Down
4 changes: 2 additions & 2 deletions include/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ int platform_driver_register(struct driver_d *drv);

int platform_device_register(struct device_d *new_device);

struct file_operations {
struct cdev_operations {
/*! Called in response of reading from this device. Required */
ssize_t (*read)(struct cdev*, void* buf, size_t count, loff_t offset, ulong flags);

Expand All @@ -441,7 +441,7 @@ struct file_operations {
#define MAX_PARTUUID_STR sizeof("00112233-4455-6677-8899-AABBCCDDEEFF")

struct cdev {
const struct file_operations *ops;
const struct cdev_operations *ops;
void *priv;
struct device_d *dev;
struct device_node *device_node;
Expand Down
2 changes: 1 addition & 1 deletion include/mfd/twl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct twlcore {
struct i2c_client *client;
};

extern struct file_operations twl_fops;
extern struct cdev_operations twl_fops;

extern int twlcore_reg_read(struct twlcore *twlcore, u16 reg, u8 *val);
extern int twlcore_reg_write(struct twlcore *twlcore, u16 reg, u8 val);
Expand Down

0 comments on commit 311282b

Please sign in to comment.