From c0afc799fb9a19a11f651596fe23b4b755593887 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 14 Dec 2022 13:35:09 +0100 Subject: Rename struct device_d to device The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer Reviewed-by: Marco Felsch Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer --- fs/bpkfs.c | 22 ++++++++++++---------- fs/cramfs/cramfs.c | 6 +++--- fs/devfs-core.c | 10 +++++----- fs/devfs.c | 31 +++++++++++++++++-------------- fs/efi.c | 44 +++++++++++++++++++++++--------------------- fs/efivarfs.c | 30 +++++++++++++++++------------- fs/ext4/ext4fs.h | 2 +- fs/ext4/ext_barebox.c | 6 +++--- fs/fat/fat.c | 33 +++++++++++++++++---------------- fs/fs.c | 10 +++++----- fs/jffs2/fs.c | 10 +++++----- fs/nfs.c | 18 +++++++++--------- fs/omap4_usbbootfs.c | 25 +++++++++++++------------ fs/pstore/fs.c | 20 ++++++++++---------- fs/pstore/ram.c | 6 +++--- fs/ramfs.c | 13 +++++++------ fs/ratpfs.c | 44 ++++++++++++++++++++++---------------------- fs/smhfs.c | 26 +++++++++++++------------- fs/squashfs/squashfs.c | 12 ++++++------ fs/squashfs/squashfs_fs_sb.h | 2 +- fs/tftp.c | 23 ++++++++++++----------- fs/ubifs/super.c | 3 ++- fs/ubifs/ubifs.c | 10 +++++----- fs/ubifs/ubifs.h | 5 +++-- fs/ubootvarfs.c | 12 ++++++------ fs/uimagefs.c | 24 +++++++++++++----------- 26 files changed, 233 insertions(+), 214 deletions(-) (limited to 'fs') diff --git a/fs/bpkfs.c b/fs/bpkfs.c index 147f4735d9..bab989c4c0 100644 --- a/fs/bpkfs.c +++ b/fs/bpkfs.c @@ -127,7 +127,7 @@ static struct bpkfs_handle_data *bpkfs_get_by_type( return NULL; } -static int bpkfs_open(struct device_d *dev, FILE *f, const char *filename) +static int bpkfs_open(struct device *dev, FILE *f, const char *filename) { struct bpkfs_handle *priv = dev->priv; struct bpkfs_handle_data *d; @@ -171,7 +171,7 @@ out: return ret; } -static int bpkfs_close(struct device_d *dev, FILE *file) +static int bpkfs_close(struct device *dev, FILE *file) { struct bpkfs_handle_data *d = file->priv; @@ -180,7 +180,8 @@ static int bpkfs_close(struct device_d *dev, FILE *file) return 0; } -static int bpkfs_read(struct device_d *dev, FILE *file, void *buf, size_t insize) +static int bpkfs_read(struct device *dev, FILE *file, void *buf, + size_t insize) { struct bpkfs_handle_data *d = file->priv; @@ -192,7 +193,7 @@ static int bpkfs_read(struct device_d *dev, FILE *file, void *buf, size_t insize } } -static int bpkfs_lseek(struct device_d *dev, FILE *file, loff_t pos) +static int bpkfs_lseek(struct device *dev, FILE *file, loff_t pos) { struct bpkfs_handle_data *d = file->priv; @@ -211,7 +212,7 @@ struct somfy_readdir { DIR dir; }; -static DIR *bpkfs_opendir(struct device_d *dev, const char *pathname) +static DIR *bpkfs_opendir(struct device *dev, const char *pathname) { struct bpkfs_handle *priv = dev->priv; struct somfy_readdir *sdir; @@ -242,7 +243,7 @@ static DIR *bpkfs_opendir(struct device_d *dev, const char *pathname) return dir; } -static struct dirent *bpkfs_readdir(struct device_d *dev, DIR *dir) +static struct dirent *bpkfs_readdir(struct device *dev, DIR *dir) { struct bpkfs_handle *priv = dev->priv; struct somfy_readdir *sdir = dir->priv; @@ -269,7 +270,7 @@ static struct dirent *bpkfs_readdir(struct device_d *dev, DIR *dir) return &dir->d; } -static int bpkfs_closedir(struct device_d *dev, DIR *dir) +static int bpkfs_closedir(struct device *dev, DIR *dir) { struct somfy_readdir *sdir = dir->priv; @@ -277,7 +278,8 @@ static int bpkfs_closedir(struct device_d *dev, DIR *dir) return 0; } -static int bpkfs_stat(struct device_d *dev, const char *filename, struct stat *s) +static int bpkfs_stat(struct device *dev, const char *filename, + struct stat *s) { struct bpkfs_handle *priv = dev->priv; struct bpkfs_handle_data *d; @@ -335,7 +337,7 @@ static void bpkfs_remove_data(struct bpkfs_handle_hw *h) } } -static void bpkfs_remove(struct device_d *dev) +static void bpkfs_remove(struct device *dev) { struct bpkfs_handle *priv = dev->priv; struct bpkfs_handle_hw *h, *tmp; @@ -349,7 +351,7 @@ static void bpkfs_remove(struct device_d *dev) free(priv); } -static int bpkfs_probe(struct device_d *dev) +static int bpkfs_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct bpkfs_handle *priv; diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c index 3ea6bd437e..6da8757888 100644 --- a/fs/cramfs/cramfs.c +++ b/fs/cramfs/cramfs.c @@ -161,7 +161,7 @@ static int cramfs_read_file(struct inode *inode, unsigned long offset, return outsize; } -static int cramfs_read(struct device_d *_dev, FILE *f, void *buf, size_t size) +static int cramfs_read(struct device *_dev, FILE *f, void *buf, size_t size) { return cramfs_read_file(f->f_inode, f->pos, buf, size); } @@ -439,7 +439,7 @@ static const struct super_operations cramfs_ops = { .destroy_inode = cramfs_destroy_inode, }; -static int cramfs_probe(struct device_d *dev) +static int cramfs_probe(struct device *dev) { struct fs_device_d *fsdev; struct cramfs_priv *priv; @@ -485,7 +485,7 @@ err_out: return ret; } -static void cramfs_remove(struct device_d *dev) +static void cramfs_remove(struct device *dev) { struct cramfs_priv *priv = dev->priv; diff --git a/fs/devfs-core.c b/fs/devfs-core.c index 93de976fb6..2a259c2fe0 100644 --- a/fs/devfs-core.c +++ b/fs/devfs-core.c @@ -127,10 +127,10 @@ struct cdev *cdev_by_diskuuid(const char *diskuuid) * @dev: the device which should be searched for partitions * @name: the partition name */ -struct cdev *device_find_partition(struct device_d *dev, const char *name) +struct cdev *device_find_partition(struct device *dev, const char *name) { struct cdev *cdev; - struct device_d *child; + struct device *child; list_for_each_entry(cdev, &dev->cdevs, devices_list) { struct cdev *cdevl; @@ -655,7 +655,7 @@ void cdev_remove_loop(struct cdev *cdev) free(cdev); } -ssize_t mem_copy(struct device_d *dev, void *dst, const void *src, +ssize_t mem_copy(struct device *dev, void *dst, const void *src, resource_size_t count, resource_size_t offset, unsigned long flags) { @@ -706,7 +706,7 @@ out: ssize_t mem_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, unsigned long flags) { - struct device_d *dev = cdev->dev; + struct device *dev = cdev->dev; if (!dev) return -1; @@ -719,7 +719,7 @@ EXPORT_SYMBOL(mem_read); ssize_t mem_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, unsigned long flags) { - struct device_d *dev = cdev->dev; + struct device *dev = cdev->dev; if (!dev) return -1; diff --git a/fs/devfs.c b/fs/devfs.c index 3e9d68e91e..08ce8b7bdd 100644 --- a/fs/devfs.c +++ b/fs/devfs.c @@ -35,14 +35,15 @@ struct devfs_inode { struct cdev *cdev; }; -static int devfs_read(struct device_d *_dev, FILE *f, void *buf, size_t size) +static int devfs_read(struct device *_dev, FILE *f, void *buf, size_t size) { struct cdev *cdev = f->priv; return cdev_read(cdev, buf, size, f->pos, f->flags); } -static int devfs_write(struct device_d *_dev, FILE *f, const void *buf, size_t size) +static int devfs_write(struct device *_dev, FILE *f, const void *buf, + size_t size) { struct cdev *cdev = f->priv; @@ -52,14 +53,15 @@ static int devfs_write(struct device_d *_dev, FILE *f, const void *buf, size_t s return cdev_write(cdev, buf, size, f->pos, f->flags); } -static int devfs_lseek(struct device_d *_dev, FILE *f, loff_t pos) +static int devfs_lseek(struct device *_dev, FILE *f, loff_t pos) { struct cdev *cdev = f->priv; return cdev_lseek(cdev, pos); } -static int devfs_erase(struct device_d *_dev, FILE *f, loff_t count, loff_t offset) +static int devfs_erase(struct device *_dev, FILE *f, loff_t count, + loff_t offset) { struct cdev *cdev = f->priv; @@ -72,14 +74,15 @@ static int devfs_erase(struct device_d *_dev, FILE *f, loff_t count, loff_t offs return cdev_erase(cdev, count, offset); } -static int devfs_protect(struct device_d *dev, FILE *f, size_t count, loff_t offset, int prot) +static int devfs_protect(struct device *dev, FILE *f, size_t count, + loff_t offset, int prot) { struct cdev *cdev = f->priv; return cdev_protect(cdev, count, offset, prot); } -static int devfs_discard_range(struct device_d *dev, FILE *f, loff_t count, +static int devfs_discard_range(struct device *dev, FILE *f, loff_t count, loff_t offset) { struct cdev *cdev = f->priv; @@ -87,14 +90,14 @@ static int devfs_discard_range(struct device_d *dev, FILE *f, loff_t count, return cdev_discard_range(cdev, count, offset); } -static int devfs_memmap(struct device_d *_dev, FILE *f, void **map, int flags) +static int devfs_memmap(struct device *_dev, FILE *f, void **map, int flags) { struct cdev *cdev = f->priv; return cdev_memmap(cdev, map, flags); } -static int devfs_open(struct device_d *_dev, FILE *f, const char *filename) +static int devfs_open(struct device *_dev, FILE *f, const char *filename) { struct inode *inode = f->f_inode; struct devfs_inode *node = container_of(inode, struct devfs_inode, inode); @@ -116,7 +119,7 @@ static int devfs_open(struct device_d *_dev, FILE *f, const char *filename) return 0; } -static int devfs_close(struct device_d *_dev, FILE *f) +static int devfs_close(struct device *_dev, FILE *f) { struct cdev *cdev = f->priv; int ret; @@ -132,21 +135,21 @@ static int devfs_close(struct device_d *_dev, FILE *f) return 0; } -static int devfs_flush(struct device_d *_dev, FILE *f) +static int devfs_flush(struct device *_dev, FILE *f) { struct cdev *cdev = f->priv; return cdev_flush(cdev); } -static int devfs_ioctl(struct device_d *_dev, FILE *f, int request, void *buf) +static int devfs_ioctl(struct device *_dev, FILE *f, int request, void *buf) { struct cdev *cdev = f->priv; return cdev_ioctl(cdev, request, buf); } -static int devfs_truncate(struct device_d *dev, FILE *f, loff_t size) +static int devfs_truncate(struct device *dev, FILE *f, loff_t size) { struct cdev *cdev = f->priv; @@ -292,7 +295,7 @@ static const struct super_operations devfs_ops = { .destroy_inode = devfs_destroy_inode, }; -static int devfs_probe(struct device_d *dev) +static int devfs_probe(struct device *dev) { struct inode *inode; struct fs_device_d *fsdev = dev_to_fs_device(dev); @@ -307,7 +310,7 @@ static int devfs_probe(struct device_d *dev) return 0; } -static void devfs_delete(struct device_d *dev) +static void devfs_delete(struct device *dev) { } diff --git a/fs/efi.c b/fs/efi.c index ca43cf6c48..4afd139623 100644 --- a/fs/efi.c +++ b/fs/efi.c @@ -128,7 +128,7 @@ static wchar_t *path_to_efi(const char *path) return ret; } -static int efifs_create(struct device_d *dev, const char *pathname, mode_t mode) +static int efifs_create(struct device *dev, const char *pathname, mode_t mode) { struct efifs_priv *priv = dev->priv; wchar_t *efi_path = path_to_efi(pathname); @@ -151,7 +151,7 @@ static int efifs_create(struct device_d *dev, const char *pathname, mode_t mode) return 0; } -static int efifs_unlink(struct device_d *dev, const char *pathname) +static int efifs_unlink(struct device *dev, const char *pathname) { struct efifs_priv *priv = dev->priv; wchar_t *efi_path = path_to_efi(pathname); @@ -173,7 +173,7 @@ static int efifs_unlink(struct device_d *dev, const char *pathname) return 0; } -static int efifs_mkdir(struct device_d *dev, const char *pathname) +static int efifs_mkdir(struct device *dev, const char *pathname) { struct efifs_priv *priv = dev->priv; wchar_t *efi_path = path_to_efi(pathname); @@ -196,12 +196,12 @@ static int efifs_mkdir(struct device_d *dev, const char *pathname) return 0; } -static int efifs_rmdir(struct device_d *dev, const char *pathname) +static int efifs_rmdir(struct device *dev, const char *pathname) { return efifs_unlink(dev, pathname); } -static int efifs_open(struct device_d *dev, FILE *f, const char *filename) +static int efifs_open(struct device *dev, FILE *f, const char *filename) { struct efifs_priv *priv = dev->priv; efi_status_t efiret; @@ -249,7 +249,7 @@ out: return ret; } -static int efifs_close(struct device_d *dev, FILE *f) +static int efifs_close(struct device *dev, FILE *f) { struct efifs_file *ufile = f->priv; @@ -260,7 +260,7 @@ static int efifs_close(struct device_d *dev, FILE *f) return 0; } -static int efifs_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) +static int efifs_read(struct device *_dev, FILE *f, void *buf, size_t insize) { struct efifs_file *ufile = f->priv; efi_status_t efiret; @@ -274,7 +274,8 @@ static int efifs_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) return bufsize; } -static int efifs_write(struct device_d *_dev, FILE *f, const void *buf, size_t insize) +static int efifs_write(struct device *_dev, FILE *f, const void *buf, + size_t insize) { struct efifs_file *ufile = f->priv; efi_status_t efiret; @@ -289,7 +290,7 @@ static int efifs_write(struct device_d *_dev, FILE *f, const void *buf, size_t i return bufsize; } -static int efifs_lseek(struct device_d *dev, FILE *f, loff_t pos) +static int efifs_lseek(struct device *dev, FILE *f, loff_t pos) { struct efifs_file *ufile = f->priv; efi_status_t efiret; @@ -302,7 +303,7 @@ static int efifs_lseek(struct device_d *dev, FILE *f, loff_t pos) return 0; } -static int efifs_truncate(struct device_d *dev, FILE *f, loff_t size) +static int efifs_truncate(struct device *dev, FILE *f, loff_t size) { struct efifs_file *ufile = f->priv; efi_status_t efiret; @@ -336,7 +337,7 @@ out: return ret; } -static DIR *efifs_opendir(struct device_d *dev, const char *pathname) +static DIR *efifs_opendir(struct device *dev, const char *pathname) { struct efifs_priv *priv = dev->priv; efi_status_t efiret; @@ -356,7 +357,7 @@ static DIR *efifs_opendir(struct device_d *dev, const char *pathname) return &udir->dir; } -static struct dirent *efifs_readdir(struct device_d *dev, DIR *dir) +static struct dirent *efifs_readdir(struct device *dev, DIR *dir) { struct efifs_dir *udir = container_of(dir, struct efifs_dir, dir); efi_status_t efiret; @@ -375,7 +376,7 @@ static struct dirent *efifs_readdir(struct device_d *dev, DIR *dir) return &dir->d; } -static int efifs_closedir(struct device_d *dev, DIR *dir) +static int efifs_closedir(struct device *dev, DIR *dir) { struct efifs_dir *udir = container_of(dir, struct efifs_dir, dir); @@ -386,7 +387,8 @@ static int efifs_closedir(struct device_d *dev, DIR *dir) return 0; } -static int efifs_stat(struct device_d *dev, const char *filename, struct stat *s) +static int efifs_stat(struct device *dev, const char *filename, + struct stat *s) { struct efifs_priv *priv = dev->priv; wchar_t *efi_path; @@ -435,25 +437,25 @@ out_free: return ret; } -static int efifs_symlink(struct device_d *dev, const char *pathname, - const char *newpath) +static int efifs_symlink(struct device *dev, const char *pathname, + const char *newpath) { return -EROFS; } -static int efifs_readlink(struct device_d *dev, const char *pathname, - char *buf, size_t bufsiz) +static int efifs_readlink(struct device *dev, const char *pathname, + char *buf, size_t bufsiz) { return -ENOENT; } -static int efifs_probe(struct device_d *dev) +static int efifs_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct efifs_priv *priv; efi_status_t efiret; struct efi_file_handle *file; - struct device_d *efi = get_device_by_name(fsdev->backingstore); + struct device *efi = get_device_by_name(fsdev->backingstore); struct efi_device *udev = container_of(efi, struct efi_device, dev); priv = xzalloc(sizeof(struct efifs_priv)); @@ -472,7 +474,7 @@ static int efifs_probe(struct device_d *dev) return 0; } -static void efifs_remove(struct device_d *dev) +static void efifs_remove(struct device *dev) { free(dev->priv); } diff --git a/fs/efivarfs.c b/fs/efivarfs.c index 2e72bb8852..bba2c33340 100644 --- a/fs/efivarfs.c +++ b/fs/efivarfs.c @@ -47,7 +47,8 @@ struct efivarfs_priv { struct list_head inodes; }; -static int efivars_create(struct device_d *dev, const char *pathname, mode_t mode) +static int efivars_create(struct device *dev, const char *pathname, + mode_t mode) { struct efivarfs_priv *priv = dev->priv; struct efivarfs_inode *inode; @@ -93,7 +94,7 @@ static int efivars_create(struct device_d *dev, const char *pathname, mode_t mod return 0; } -static int efivars_unlink(struct device_d *dev, const char *pathname) +static int efivars_unlink(struct device *dev, const char *pathname) { struct efivarfs_priv *priv = dev->priv; struct efivarfs_inode *inode, *tmp; @@ -124,7 +125,7 @@ struct efivars_file { u32 attributes; }; -static int efivarfs_open(struct device_d *dev, FILE *f, const char *filename) +static int efivarfs_open(struct device *dev, FILE *f, const char *filename) { struct efivars_file *efile; efi_status_t efiret; @@ -169,7 +170,7 @@ out: return ret; } -static int efivarfs_close(struct device_d *dev, FILE *f) +static int efivarfs_close(struct device *dev, FILE *f) { struct efivars_file *efile = f->priv; @@ -179,7 +180,8 @@ static int efivarfs_close(struct device_d *dev, FILE *f) return 0; } -static int efivarfs_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) +static int efivarfs_read(struct device *_dev, FILE *f, void *buf, + size_t insize) { struct efivars_file *efile = f->priv; @@ -188,7 +190,8 @@ static int efivarfs_read(struct device_d *_dev, FILE *f, void *buf, size_t insiz return insize; } -static int efivarfs_write(struct device_d *_dev, FILE *f, const void *buf, size_t insize) +static int efivarfs_write(struct device *_dev, FILE *f, const void *buf, + size_t insize) { struct efivars_file *efile = f->priv; efi_status_t efiret; @@ -209,7 +212,7 @@ static int efivarfs_write(struct device_d *_dev, FILE *f, const void *buf, size_ return insize; } -static int efivarfs_truncate(struct device_d *dev, FILE *f, loff_t size) +static int efivarfs_truncate(struct device *dev, FILE *f, loff_t size) { struct efivars_file *efile = f->priv; efi_status_t efiret; @@ -228,7 +231,7 @@ static int efivarfs_truncate(struct device_d *dev, FILE *f, loff_t size) return 0; } -static DIR *efivarfs_opendir(struct device_d *dev, const char *pathname) +static DIR *efivarfs_opendir(struct device *dev, const char *pathname) { struct efivarfs_priv *priv = dev->priv; struct efivarfs_dir *edir; @@ -239,7 +242,7 @@ static DIR *efivarfs_opendir(struct device_d *dev, const char *pathname) return &edir->dir; } -static struct dirent *efivarfs_readdir(struct device_d *dev, DIR *dir) +static struct dirent *efivarfs_readdir(struct device *dev, DIR *dir) { struct efivarfs_priv *priv = dev->priv; struct efivarfs_dir *edir = container_of(dir, struct efivarfs_dir, dir); @@ -257,7 +260,7 @@ static struct dirent *efivarfs_readdir(struct device_d *dev, DIR *dir) return &dir->d; } -static int efivarfs_closedir(struct device_d *dev, DIR *dir) +static int efivarfs_closedir(struct device *dev, DIR *dir) { struct efivarfs_dir *edir = container_of(dir, struct efivarfs_dir, dir); @@ -266,7 +269,8 @@ static int efivarfs_closedir(struct device_d *dev, DIR *dir) return 0; } -static int efivarfs_stat(struct device_d *dev, const char *filename, struct stat *s) +static int efivarfs_stat(struct device *dev, const char *filename, + struct stat *s) { efi_guid_t vendor; s16 *name; @@ -291,7 +295,7 @@ static int efivarfs_stat(struct device_d *dev, const char *filename, struct stat return 0; } -static int efivarfs_probe(struct device_d *dev) +static int efivarfs_probe(struct device *dev) { efi_status_t efiret; efi_guid_t vendor; @@ -330,7 +334,7 @@ static int efivarfs_probe(struct device_d *dev) return 0; } -static void efivarfs_remove(struct device_d *dev) +static void efivarfs_remove(struct device *dev) { struct efivarfs_priv *priv = dev->priv; struct efivarfs_inode *inode, *tmp; diff --git a/fs/ext4/ext4fs.h b/fs/ext4/ext4fs.h index 83ae9b87a4..707565e671 100644 --- a/fs/ext4/ext4fs.h +++ b/fs/ext4/ext4fs.h @@ -84,7 +84,7 @@ struct ext_filesystem { struct ext2_data *data; - struct device_d *dev; + struct device *dev; }; struct ext2fs_node; diff --git a/fs/ext4/ext_barebox.c b/fs/ext4/ext_barebox.c index 6c7c9885c4..9e91288b8e 100644 --- a/fs/ext4/ext_barebox.c +++ b/fs/ext4/ext_barebox.c @@ -48,7 +48,7 @@ static inline struct ext2fs_node *to_ext2_node(struct inode *inode) return container_of(inode, struct ext2fs_node, i); } -static int ext_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) +static int ext_read(struct device *_dev, FILE *f, void *buf, size_t insize) { struct inode *inode = f->f_inode; struct ext2fs_node *node = to_ext2_node(inode); @@ -249,7 +249,7 @@ struct inode *ext_get_inode(struct super_block *sb, int ino) return inode; } -static int ext_probe(struct device_d *dev) +static int ext_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); int ret; @@ -290,7 +290,7 @@ err: return ret; } -static void ext_remove(struct device_d *dev) +static void ext_remove(struct device *dev) { struct ext_filesystem *fs = dev->priv; diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 7d888817c1..b9c0a6e7fa 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -68,7 +68,7 @@ DRESULT disk_write(FATFS *fat, const BYTE *buf, DWORD sector, BYTE count) /* ---------------------------------------------------------------*/ #ifdef CONFIG_FS_FAT_WRITE -static int fat_create(struct device_d *dev, const char *pathname, mode_t mode) +static int fat_create(struct device *dev, const char *pathname, mode_t mode) { struct fat_priv *priv = dev->priv; FIL f_file; @@ -83,7 +83,7 @@ static int fat_create(struct device_d *dev, const char *pathname, mode_t mode) return 0; } -static int fat_unlink(struct device_d *dev, const char *pathname) +static int fat_unlink(struct device *dev, const char *pathname) { struct fat_priv *priv = dev->priv; int ret; @@ -97,7 +97,7 @@ static int fat_unlink(struct device_d *dev, const char *pathname) return 0; } -static int fat_mkdir(struct device_d *dev, const char *pathname) +static int fat_mkdir(struct device *dev, const char *pathname) { struct fat_priv *priv = dev->priv; int ret; @@ -111,7 +111,7 @@ static int fat_mkdir(struct device_d *dev, const char *pathname) return 0; } -static int fat_rmdir(struct device_d *dev, const char *pathname) +static int fat_rmdir(struct device *dev, const char *pathname) { struct fat_priv *priv = dev->priv; int ret; @@ -125,7 +125,8 @@ static int fat_rmdir(struct device_d *dev, const char *pathname) return 0; } -static int fat_write(struct device_d *_dev, FILE *f, const void *buf, size_t insize) +static int fat_write(struct device *_dev, FILE *f, const void *buf, + size_t insize) { FIL *f_file = f->priv; int outsize; @@ -143,7 +144,7 @@ static int fat_write(struct device_d *_dev, FILE *f, const void *buf, size_t ins return outsize; } -static int fat_truncate(struct device_d *dev, FILE *f, loff_t size) +static int fat_truncate(struct device *dev, FILE *f, loff_t size) { FIL *f_file = f->priv; unsigned long lastofs; @@ -167,7 +168,7 @@ static int fat_truncate(struct device_d *dev, FILE *f, loff_t size) } #endif /* CONFIG_FS_FAT_WRITE */ -static int fat_open(struct device_d *dev, FILE *file, const char *filename) +static int fat_open(struct device *dev, FILE *file, const char *filename) { struct fat_priv *priv = dev->priv; FIL *f_file; @@ -209,7 +210,7 @@ static int fat_open(struct device_d *dev, FILE *file, const char *filename) return 0; } -static int fat_close(struct device_d *dev, FILE *f) +static int fat_close(struct device *dev, FILE *f) { struct fat_priv *priv = dev->priv; FIL *f_file = f->priv; @@ -223,7 +224,7 @@ static int fat_close(struct device_d *dev, FILE *f) return 0; } -static int fat_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) +static int fat_read(struct device *_dev, FILE *f, void *buf, size_t insize) { int ret; FIL *f_file = f->priv; @@ -239,7 +240,7 @@ static int fat_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) return outsize; } -static int fat_lseek(struct device_d *dev, FILE *f, loff_t pos) +static int fat_lseek(struct device *dev, FILE *f, loff_t pos) { FIL *f_file = f->priv; int ret; @@ -251,7 +252,7 @@ static int fat_lseek(struct device_d *dev, FILE *f, loff_t pos) return 0; } -static DIR* fat_opendir(struct device_d *dev, const char *pathname) +static DIR* fat_opendir(struct device *dev, const char *pathname) { struct fat_priv *priv = dev->priv; DIR *dir; @@ -276,7 +277,7 @@ static DIR* fat_opendir(struct device_d *dev, const char *pathname) return dir; } -static struct dirent* fat_readdir(struct device_d *dev, DIR *dir) +static struct dirent* fat_readdir(struct device *dev, DIR *dir) { FF_DIR *ff_dir = dir->priv; FILINFO finfo; @@ -306,7 +307,7 @@ static struct dirent* fat_readdir(struct device_d *dev, DIR *dir) return &dir->d; } -static int fat_closedir(struct device_d *dev, DIR *dir) +static int fat_closedir(struct device *dev, DIR *dir) { FF_DIR *ff_dir = dir->priv; @@ -316,7 +317,7 @@ static int fat_closedir(struct device_d *dev, DIR *dir) return 0; } -static int fat_stat(struct device_d *dev, const char *filename, struct stat *s) +static int fat_stat(struct device *dev, const char *filename, struct stat *s) { struct fat_priv *priv = dev->priv; FILINFO finfo; @@ -339,7 +340,7 @@ static int fat_stat(struct device_d *dev, const char *filename, struct stat *s) return 0; } -static int fat_probe(struct device_d *dev) +static int fat_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct fat_priv *priv = xzalloc(sizeof(struct fat_priv)); @@ -367,7 +368,7 @@ err_open: return ret; } -static void fat_remove(struct device_d *dev) +static void fat_remove(struct device *dev) { free(dev->priv); } diff --git a/fs/fs.c b/fs/fs.c index b5a0912405..4f6e7f8607 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -311,7 +311,7 @@ int creat(const char *pathname, mode_t mode) } EXPORT_SYMBOL(creat); -static int fsdev_truncate(struct device_d *dev, FILE *f, loff_t length) +static int fsdev_truncate(struct device *dev, FILE *f, loff_t length) { struct fs_driver_d *fsdrv = f->fsdev->driver; @@ -726,12 +726,12 @@ int close(int fd) } EXPORT_SYMBOL(close); -static int fs_match(struct device_d *dev, struct driver_d *drv) +static int fs_match(struct device *dev, struct driver_d *drv) { return strcmp(dev->name, drv->name) ? -1 : 0; } -static int fs_probe(struct device_d *dev) +static int fs_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct driver_d *drv = dev->driver; @@ -791,7 +791,7 @@ static void destroy_inode(struct inode *inode) free(inode); } -static void fs_remove(struct device_d *dev) +static void fs_remove(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct super_block *sb = &fsdev->sb; @@ -1141,7 +1141,7 @@ const char *cdev_mount(struct cdev *cdev) */ void mount_all(void) { - struct device_d *dev; + struct device *dev; struct block_device *bdev; if (!IS_ENABLED(CONFIG_BLOCK)) diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 15bb63990b..3a56094b3c 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -40,7 +40,7 @@ static inline void i_gid_write(struct inode *inode, gid_t gid) const struct file_operations jffs2_file_operations; const struct inode_operations jffs2_file_inode_operations; -static int jffs2_open(struct device_d *dev, FILE *file, const char *filename) +static int jffs2_open(struct device *dev, FILE *file, const char *filename) { struct inode *inode = file->f_inode; struct jffs2_file *jf; @@ -56,7 +56,7 @@ static int jffs2_open(struct device_d *dev, FILE *file, const char *filename) return 0; } -static int jffs2_close(struct device_d *dev, FILE *f) +static int jffs2_close(struct device *dev, FILE *f) { struct jffs2_file *jf = f->priv; @@ -86,7 +86,7 @@ static int jffs2_get_block(struct jffs2_file *jf, unsigned int pos) return 0; } -static int jffs2_read(struct device_d *_dev, FILE *f, void *buf, +static int jffs2_read(struct device *_dev, FILE *f, void *buf, size_t insize) { struct jffs2_file *jf = f->priv; @@ -401,7 +401,7 @@ void jffs2_flash_cleanup(struct jffs2_sb_info *c) { static int jffs2_probe_cnt; -static int jffs2_probe(struct device_d *dev) +static int jffs2_probe(struct device *dev) { struct fs_device_d *fsdev; struct super_block *sb; @@ -448,7 +448,7 @@ err_out: return ret; } -static void jffs2_remove(struct device_d *dev) +static void jffs2_remove(struct device *dev) { struct fs_device_d *fsdev; struct super_block *sb; diff --git a/fs/nfs.c b/fs/nfs.c index fae7b722f5..5a1b7b6531 100644 --- a/fs/nfs.c +++ b/fs/nfs.c @@ -1059,7 +1059,7 @@ static void nfs_handler(void *ctx, char *p, unsigned len) list_add_tail(&packet->list, &npriv->packets); } -static int nfs_truncate(struct device_d *dev, FILE *f, loff_t size) +static int nfs_truncate(struct device *dev, FILE *f, loff_t size) { return -ENOSYS; } @@ -1150,7 +1150,7 @@ static const char *nfs_get_link(struct dentry *dentry, struct inode *inode) return inode->i_link; } -static int nfs_open(struct device_d *dev, FILE *file, const char *filename) +static int nfs_open(struct device *dev, FILE *file, const char *filename) { struct inode *inode = file->f_inode; struct nfs_inode *ninode = nfsi(inode); @@ -1172,7 +1172,7 @@ static int nfs_open(struct device_d *dev, FILE *file, const char *filename) return 0; } -static int nfs_close(struct device_d *dev, FILE *file) +static int nfs_close(struct device *dev, FILE *file) { struct file_priv *priv = file->priv; @@ -1181,13 +1181,13 @@ static int nfs_close(struct device_d *dev, FILE *file) return 0; } -static int nfs_write(struct device_d *_dev, FILE *file, const void *inbuf, - size_t insize) +static int nfs_write(struct device *_dev, FILE *file, const void *inbuf, + size_t insize) { return -ENOSYS; } -static int nfs_read(struct device_d *dev, FILE *file, void *buf, size_t insize) +static int nfs_read(struct device *dev, FILE *file, void *buf, size_t insize) { struct file_priv *priv = file->priv; @@ -1203,7 +1203,7 @@ static int nfs_read(struct device_d *dev, FILE *file, void *buf, size_t insize) return kfifo_get(priv->fifo, buf, insize); } -static int nfs_lseek(struct device_d *dev, FILE *file, loff_t pos) +static int nfs_lseek(struct device *dev, FILE *file, loff_t pos) { struct file_priv *priv = file->priv; @@ -1419,7 +1419,7 @@ static void nfs_set_rootarg(struct nfs_priv *npriv, struct fs_device_d *fsdev) free(str); } -static int nfs_probe(struct device_d *dev) +static int nfs_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct nfs_priv *npriv = xzalloc(sizeof(struct nfs_priv)); @@ -1519,7 +1519,7 @@ err: return ret; } -static void nfs_remove(struct device_d *dev) +static void nfs_remove(struct device *dev) { struct nfs_priv *npriv = dev->priv; diff --git a/fs/omap4_usbbootfs.c b/fs/omap4_usbbootfs.c index 4f159210d1..1ccfe14182 100644 --- a/fs/omap4_usbbootfs.c +++ b/fs/omap4_usbbootfs.c @@ -30,8 +30,9 @@ struct file_priv { u32 size; }; -static struct file_priv *omap4_usbbootfs_do_open( - struct device_d *dev, int accmode, const char *filename) +static struct file_priv *omap4_usbbootfs_do_open(struct device *dev, + int accmode, + const char *filename) { struct file_priv *priv; u32 data; @@ -60,8 +61,8 @@ static struct file_priv *omap4_usbbootfs_do_open( return priv; } -static int omap4_usbbootfs_open( - struct device_d *dev, FILE *file, const char *filename) +static int omap4_usbbootfs_open(struct device *dev, FILE *file, + const char *filename) { struct file_priv *priv; @@ -86,14 +87,14 @@ static int omap4_usbbootfs_do_close(struct file_priv *priv) return 0; } -static int omap4_usbbootfs_close(struct device_d *dev, FILE *f) +static int omap4_usbbootfs_close(struct device *dev, FILE *f) { struct file_priv *priv = f->priv; return omap4_usbbootfs_do_close(priv); } -static int omap4_usbbootfs_read( - struct device_d *dev, FILE *f, void *buf, size_t size) +static int omap4_usbbootfs_read(struct device *dev, FILE *f, void *buf, + size_t size) { struct file_priv *priv = f->priv; u32 data; @@ -116,13 +117,13 @@ static int omap4_usbbootfs_read( return size; } -static DIR *omap4_usbbootfs_opendir(struct device_d *dev, const char *pathname) +static DIR *omap4_usbbootfs_opendir(struct device *dev, const char *pathname) { return NULL; } -static int omap4_usbbootfs_stat( - struct device_d *dev, const char *filename, struct stat *s) +static int omap4_usbbootfs_stat(struct device *dev, const char *filename, + struct stat *s) { struct file_priv *priv; @@ -140,11 +141,11 @@ static int omap4_usbbootfs_stat( return 0; } -static int omap4_usbbootfs_probe(struct device_d *dev) +static int omap4_usbbootfs_probe(struct device *dev) { return 0; } -static void omap4_usbbootfs_remove(struct device_d *dev) +static void omap4_usbbootfs_remove(struct device *dev) { } diff --git a/fs/pstore/fs.c b/fs/pstore/fs.c index b41c87665c..24b5306d15 100644 --- a/fs/pstore/fs.c +++ b/fs/pstore/fs.c @@ -138,7 +138,7 @@ static struct pstore_private *pstore_get_by_name(struct list_head *head, return NULL; } -static int pstore_open(struct device_d *dev, FILE *file, const char *filename) +static int pstore_open(struct device *dev, FILE *file, const char *filename) { struct list_head *head = dev->priv; struct pstore_private *d; @@ -157,12 +157,12 @@ static int pstore_open(struct device_d *dev, FILE *file, const char *filename) return 0; } -static int pstore_close(struct device_d *dev, FILE *file) +static int pstore_close(struct device *dev, FILE *file) { return 0; } -static int pstore_read(struct device_d *dev, FILE *file, void *buf, +static int pstore_read(struct device *dev, FILE *file, void *buf, size_t insize) { struct pstore_private *d = file->priv; @@ -173,7 +173,7 @@ static int pstore_read(struct device_d *dev, FILE *file, void *buf, return insize; } -static int pstore_lseek(struct device_d *dev, FILE *file, loff_t pos) +static int pstore_lseek(struct device *dev, FILE *file, loff_t pos) { struct pstore_private *d = file->priv; @@ -182,7 +182,7 @@ static int pstore_lseek(struct device_d *dev, FILE *file, loff_t pos) return 0; } -static DIR *pstore_opendir(struct device_d *dev, const char *pathname) +static DIR *pstore_opendir(struct device *dev, const char *pathname) { DIR *dir; @@ -196,7 +196,7 @@ static DIR *pstore_opendir(struct device_d *dev, const char *pathname) return dir; } -static struct dirent *pstore_readdir(struct device_d *dev, DIR *dir) +static struct dirent *pstore_readdir(struct device *dev, DIR *dir) { struct pstore_private *d = dir->priv; @@ -209,14 +209,14 @@ static struct dirent *pstore_readdir(struct device_d *dev, DIR *dir) return &dir->d; } -static int pstore_closedir(struct device_d *dev, DIR *dir) +static int pstore_closedir(struct device *dev, DIR *dir) { free(dir); return 0; } -static int pstore_stat(struct device_d *dev, const char *filename, +static int pstore_stat(struct device *dev, const char *filename, struct stat *s) { struct pstore_private *d; @@ -234,7 +234,7 @@ static int pstore_stat(struct device_d *dev, const char *filename, return 0; } -static void pstore_remove(struct device_d *dev) +static void pstore_remove(struct device *dev) { struct pstore_private *d, *tmp; @@ -243,7 +243,7 @@ static void pstore_remove(struct device_d *dev) } } -static int pstore_probe(struct device_d *dev) +static int pstore_probe(struct device *dev) { struct list_head *priv = &allpstore; diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index c1c8b0caab..6a57586543 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -410,7 +410,7 @@ static int ramoops_init_prz(const char *name, return 0; } -static int ramoops_parse_dt_size(struct device_d *dev, +static int ramoops_parse_dt_size(struct device *dev, const char *propname, u32 *value) { u32 val32 = 0; @@ -432,7 +432,7 @@ static int ramoops_parse_dt_size(struct device_d *dev, return 0; } -static int ramoops_parse_dt(struct device_d *dev, +static int ramoops_parse_dt(struct device *dev, struct ramoops_platform_data *pdata) { struct device_node *of_node = dev->of_node; @@ -517,7 +517,7 @@ static int ramoops_of_fixup(struct device_node *root, void *data) return 0; } -static int ramoops_probe(struct device_d *dev) +static int ramoops_probe(struct device *dev) { struct ramoops_platform_data *pdata = dummy_data; struct ramoops_context *cxt = &oops_cxt; diff --git a/fs/ramfs.c b/fs/ramfs.c index bdaa91dd9e..127ff7de82 100644 --- a/fs/ramfs.c +++ b/fs/ramfs.c @@ -221,7 +221,7 @@ static struct ramfs_chunk *ramfs_find_chunk(struct ramfs_inode *node, return NULL; } -static int ramfs_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) +static int ramfs_read(struct device *_dev, FILE *f, void *buf, size_t insize) { struct inode *inode = f->f_inode; struct ramfs_inode *node = to_ramfs_inode(inode); @@ -251,7 +251,8 @@ static int ramfs_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) return insize; } -static int ramfs_write(struct device_d *_dev, FILE *f, const void *buf, size_t insize) +static int ramfs_write(struct device *_dev, FILE *f, const void *buf, + size_t insize) { struct inode *inode = f->f_inode; struct ramfs_inode *node = to_ramfs_inode(inode); @@ -355,7 +356,7 @@ out: return -ENOSPC; } -static int ramfs_truncate(struct device_d *dev, FILE *f, loff_t size) +static int ramfs_truncate(struct device *dev, FILE *f, loff_t size) { struct inode *inode = f->f_inode; struct ramfs_inode *node = to_ramfs_inode(inode); @@ -387,7 +388,7 @@ static int ramfs_truncate(struct device_d *dev, FILE *f, loff_t size) return 0; } -static int ramfs_memmap(struct device_d *_dev, FILE *f, void **map, int flags) +static int ramfs_memmap(struct device *_dev, FILE *f, void **map, int flags) { struct inode *inode = f->f_inode; struct ramfs_inode *node = to_ramfs_inode(inode); @@ -431,7 +432,7 @@ static const struct super_operations ramfs_ops = { .destroy_inode = ramfs_destroy_inode, }; -static int ramfs_probe(struct device_d *dev) +static int ramfs_probe(struct device *dev) { struct inode *inode; struct fs_device_d *fsdev = dev_to_fs_device(dev); @@ -445,7 +446,7 @@ static int ramfs_probe(struct device_d *dev) return 0; } -static void ramfs_remove(struct device_d *dev) +static void ramfs_remove(struct device *dev) { } diff --git a/fs/ratpfs.c b/fs/ratpfs.c index b6857c6016..684bc68f74 100644 --- a/fs/ratpfs.c +++ b/fs/ratpfs.c @@ -48,25 +48,25 @@ struct ratpfs_dir { DIR dir; }; -static int ratpfs_create(struct device_d __always_unused *dev, - const char __always_unused *pathname, - mode_t __always_unused mode) +static int ratpfs_create(struct device __always_unused *dev, + const char __always_unused *pathname, + mode_t __always_unused mode) { pr_debug("%s\n", __func__); return 0; } -static int ratpfs_mkdir(struct device_d __always_unused *dev, - const char __always_unused *pathname) +static int ratpfs_mkdir(struct device __always_unused *dev, + const char __always_unused *pathname) { pr_debug("%s\n", __func__); return -ENOSYS; } -static int ratpfs_rm(struct device_d __always_unused *dev, - const char *pathname) +static int ratpfs_rm(struct device __always_unused *dev, + const char *pathname) { pr_debug("%s\n", __func__); @@ -76,8 +76,8 @@ static int ratpfs_rm(struct device_d __always_unused *dev, return 0; } -static int ratpfs_truncate(struct device_d __always_unused *dev, - FILE *f, loff_t size) +static int ratpfs_truncate(struct device __always_unused *dev, + FILE *f, loff_t size) { int len_tx = 1 /* type */ + 4 /* handle */ @@ -114,8 +114,8 @@ out: return ret; } -static int ratpfs_open(struct device_d __always_unused *dev, - FILE *file, const char *filename) +static int ratpfs_open(struct device __always_unused *dev, + FILE *file, const char *filename) { int len_name = strlen(filename); int len_tx = 1 /* type */ @@ -163,7 +163,7 @@ out: return ret; } -static int ratpfs_close(struct device_d __always_unused *dev, +static int ratpfs_close(struct device __always_unused *dev, FILE *f) { int len_tx = 1 /* type */ @@ -198,7 +198,7 @@ out: return ret; } -static int ratpfs_write(struct device_d __always_unused *dev, +static int ratpfs_write(struct device __always_unused *dev, FILE *f, const void *buf, size_t orig_size) { int size = min((int)orig_size, 4096); @@ -241,7 +241,7 @@ out: return ret; } -static int ratpfs_read(struct device_d __always_unused *dev, +static int ratpfs_read(struct device __always_unused *dev, FILE *f, void *buf, size_t orig_size) { int size = min((int)orig_size, 4096); @@ -284,8 +284,8 @@ out: return ret; } -static DIR* ratpfs_opendir(struct device_d __always_unused *dev, - const char *pathname) +static DIR* ratpfs_opendir(struct device __always_unused *dev, + const char *pathname) { int len_name = strlen(pathname); int len_tx = 1 /* type */ @@ -318,7 +318,7 @@ static DIR* ratpfs_opendir(struct device_d __always_unused *dev, } } -static struct dirent *ratpfs_readdir(struct device_d *dev, DIR *dir) +static struct dirent *ratpfs_readdir(struct device *dev, DIR *dir) { struct ratpfs_dir *rdir = container_of(dir, struct ratpfs_dir, dir); int i; @@ -338,7 +338,7 @@ static struct dirent *ratpfs_readdir(struct device_d *dev, DIR *dir) return &dir->d; } -static int ratpfs_closedir(struct device_d *dev, DIR *dir) +static int ratpfs_closedir(struct device *dev, DIR *dir) { struct ratpfs_dir *rdir = container_of(dir, struct ratpfs_dir, dir); @@ -350,8 +350,8 @@ static int ratpfs_closedir(struct device_d *dev, DIR *dir) return 0; } -static int ratpfs_stat(struct device_d __always_unused *dev, - const char *filename, struct stat *s) +static int ratpfs_stat(struct device __always_unused *dev, + const char *filename, struct stat *s) { int len_name = strlen(filename); int len_tx = 1 /* type */ @@ -395,7 +395,7 @@ out: return ret; } -static int ratpfs_probe(struct device_d *dev) +static int ratpfs_probe(struct device *dev) { int len_tx = 1; /* type */ struct ratp_bb_pkt *pkt_tx = xzalloc(sizeof(*pkt_tx) + len_tx); @@ -431,7 +431,7 @@ out: return ret; } -static void ratpfs_remove(struct device_d __always_unused *dev) +static void ratpfs_remove(struct device __always_unused *dev) { pr_debug("%s\n", __func__); diff --git a/fs/smhfs.c b/fs/smhfs.c index 2e99b05979..6431b894f6 100644 --- a/fs/smhfs.c +++ b/fs/smhfs.c @@ -29,20 +29,20 @@ static int file_to_fd(const FILE *f) return (int)f->priv; } -static int smhfs_create(struct device_d __always_unused *dev, +static int smhfs_create(struct device __always_unused *dev, const char __always_unused *pathname, mode_t __always_unused mode) { return 0; } -static int smhfs_mkdir(struct device_d __always_unused *dev, +static int smhfs_mkdir(struct device __always_unused *dev, const char __always_unused *pathname) { return -ENOSYS; } -static int smhfs_rm(struct device_d __always_unused *dev, +static int smhfs_rm(struct device __always_unused *dev, const char *pathname) { /* Get rid of leading '/' */ @@ -54,14 +54,14 @@ static int smhfs_rm(struct device_d __always_unused *dev, return 0; } -static int smhfs_truncate(struct device_d __always_unused *dev, +static int smhfs_truncate(struct device __always_unused *dev, FILE __always_unused *f, loff_t __always_unused size) { return 0; } -static int smhfs_open(struct device_d __always_unused *dev, +static int smhfs_open(struct device __always_unused *dev, FILE *file, const char *filename) { int fd; @@ -82,7 +82,7 @@ error: return -semihosting_errno(); } -static int smhfs_close(struct device_d __always_unused *dev, +static int smhfs_close(struct device __always_unused *dev, FILE *f) { if (semihosting_close(file_to_fd(f))) @@ -91,7 +91,7 @@ static int smhfs_close(struct device_d __always_unused *dev, return 0; } -static int smhfs_write(struct device_d __always_unused *dev, +static int smhfs_write(struct device __always_unused *dev, FILE *f, const void *inbuf, size_t insize) { if (semihosting_write(file_to_fd(f), inbuf, insize)) @@ -100,7 +100,7 @@ static int smhfs_write(struct device_d __always_unused *dev, return insize; } -static int smhfs_read(struct device_d __always_unused *dev, +static int smhfs_read(struct device __always_unused *dev, FILE *f, void *buf, size_t insize) { if (!semihosting_read(file_to_fd(f), buf, insize)) @@ -109,7 +109,7 @@ static int smhfs_read(struct device_d __always_unused *dev, return -semihosting_errno(); } -static int smhfs_lseek(struct device_d __always_unused *dev, +static int smhfs_lseek(struct device __always_unused *dev, FILE *f, loff_t pos) { if (semihosting_seek(file_to_fd(f), pos)) @@ -118,13 +118,13 @@ static int smhfs_lseek(struct device_d __always_unused *dev, return 0; } -static DIR* smhfs_opendir(struct device_d __always_unused *dev, +static DIR* smhfs_opendir(struct device __always_unused *dev, const char __always_unused *pathname) { return NULL; } -static int smhfs_stat(struct device_d __always_unused *dev, +static int smhfs_stat(struct device __always_unused *dev, const char *filename, struct stat *s) { FILE file; @@ -138,13 +138,13 @@ static int smhfs_stat(struct device_d __always_unused *dev, return 0; } -static int smhfs_probe(struct device_d __always_unused *dev) +static int smhfs_probe(struct device __always_unused *dev) { /* TODO: Add provisions to detect if debugger is connected */ return 0; } -static void smhfs_remove(struct device_d __always_unused *dev) +static void smhfs_remove(struct device __always_unused *dev) { } diff --git a/fs/squashfs/squashfs.c b/fs/squashfs/squashfs.c index 030be57887..96531be0f6 100644 --- a/fs/squashfs/squashfs.c +++ b/fs/squashfs/squashfs.c @@ -90,7 +90,7 @@ static const struct super_operations squashfs_super_ops = { .destroy_inode = squashfs_destroy_inode, }; -static int squashfs_probe(struct device_d *dev) +static int squashfs_probe(struct device *dev) { struct fs_device_d *fsdev; int ret; @@ -120,7 +120,7 @@ err_out: return ret; } -static void squashfs_remove(struct device_d *dev) +static void squashfs_remove(struct device *dev) { struct fs_device_d *fsdev; struct super_block *sb; @@ -131,7 +131,7 @@ static void squashfs_remove(struct device_d *dev) squashfs_put_super(sb); } -static int squashfs_open(struct device_d *dev, FILE *file, const char *filename) +static int squashfs_open(struct device *dev, FILE *file, const char *filename) { struct inode *inode = file->f_inode; struct squashfs_page *page; @@ -165,7 +165,7 @@ error: return -ENOMEM; } -static int squashfs_close(struct device_d *dev, FILE *f) +static int squashfs_close(struct device *dev, FILE *f) { struct squashfs_page *page = f->priv; int i; @@ -197,8 +197,8 @@ static int squashfs_read_buf(struct squashfs_page *page, int pos, void **buf) return 0; } -static int squashfs_read(struct device_d *_dev, FILE *f, void *buf, - size_t insize) +static int squashfs_read(struct device *_dev, FILE *f, void *buf, + size_t insize) { unsigned int size = insize; unsigned int pos = f->pos; diff --git a/fs/squashfs/squashfs_fs_sb.h b/fs/squashfs/squashfs_fs_sb.h index 2b6f81d33a..c6fc37d48f 100644 --- a/fs/squashfs/squashfs_fs_sb.h +++ b/fs/squashfs/squashfs_fs_sb.h @@ -77,6 +77,6 @@ struct squashfs_sb_info { unsigned int inodes; int xattr_ids; struct cdev *cdev; - struct device_d *dev; + struct device *dev; }; #endif diff --git a/fs/tftp.c b/fs/tftp.c index 4e5ccff57b..e41b5da4c0 100644 --- a/fs/tftp.c +++ b/fs/tftp.c @@ -178,7 +178,7 @@ static int tftp_window_cache_insert(struct tftp_cache *cache, uint16_t id, return 0; } -static int tftp_truncate(struct device_d *dev, FILE *f, loff_t size) +static int tftp_truncate(struct device *dev, FILE *f, loff_t size) { return 0; } @@ -647,8 +647,9 @@ static int tftp_start_transfer(struct file_priv *priv) return 0; } -static struct file_priv *tftp_do_open(struct device_d *dev, - int accmode, struct dentry *dentry, bool is_getattr) +static struct file_priv *tftp_do_open(struct device *dev, + int accmode, struct dentry *dentry, + bool is_getattr) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct file_priv *priv; @@ -752,7 +753,7 @@ out: return ERR_PTR(ret); } -static int tftp_open(struct device_d *dev, FILE *file, const char *filename) +static int tftp_open(struct device *dev, FILE *file, const char *filename) { struct file_priv *priv; @@ -805,15 +806,15 @@ static int tftp_do_close(struct file_priv *priv) return 0; } -static int tftp_close(struct device_d *dev, FILE *f) +static int tftp_close(struct device *dev, FILE *f) { struct file_priv *priv = f->priv; return tftp_do_close(priv); } -static int tftp_write(struct device_d *_dev, FILE *f, const void *inbuf, - size_t insize) +static int tftp_write(struct device *_dev, FILE *f, const void *inbuf, + size_t insize) { struct file_priv *priv = f->priv; size_t size, now; @@ -848,7 +849,7 @@ static int tftp_write(struct device_d *_dev, FILE *f, const void *inbuf, return insize; } -static int tftp_read(struct device_d *dev, FILE *f, void *buf, size_t insize) +static int tftp_read(struct device *dev, FILE *f, void *buf, size_t insize) { struct file_priv *priv = f->priv; size_t outsize = 0, now; @@ -888,7 +889,7 @@ static int tftp_read(struct device_d *dev, FILE *f, void *buf, size_t insize) return outsize; } -static int tftp_lseek(struct device_d *dev, FILE *f, loff_t pos) +static int tftp_lseek(struct device *dev, FILE *f, loff_t pos) { /* We cannot seek backwards without reloading or caching the file */ loff_t f_pos = f->pos; @@ -1014,7 +1015,7 @@ static const struct inode_operations tftp_dir_inode_operations = static const struct super_operations tftp_ops; -static int tftp_probe(struct device_d *dev) +static int tftp_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct tftp_priv *priv = xzalloc(sizeof(struct tftp_priv)); @@ -1043,7 +1044,7 @@ err: return ret; } -static void tftp_remove(struct device_d *dev) +static void tftp_remove(struct device *dev) { struct tftp_priv *priv = dev->priv; diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 6a0074bd1a..37d5584454 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -1207,7 +1207,8 @@ out_shrinker: /* late_initcall to let compressors initialize first */ late_initcall(ubifs_init); -int ubifs_get_super(struct device_d *dev, struct ubi_volume_desc *ubi, int silent) +int ubifs_get_super(struct device *dev, struct ubi_volume_desc *ubi, + int silent) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct super_block *sb; diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index 6f2ea14d0e..95d5dbaff8 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -340,7 +340,7 @@ struct ubifs_file { struct ubifs_data_node *dn; }; -static int ubifs_open(struct device_d *dev, FILE *file, const char *filename) +static int ubifs_open(struct device *dev, FILE *file, const char *filename) { struct inode *inode = file->f_inode; struct ubifs_file *uf; @@ -358,7 +358,7 @@ static int ubifs_open(struct device_d *dev, FILE *file, const char *filename) return 0; } -static int ubifs_close(struct device_d *dev, FILE *f) +static int ubifs_close(struct device *dev, FILE *f) { struct ubifs_file *uf = f->priv; @@ -384,7 +384,7 @@ static int ubifs_get_block(struct ubifs_file *uf, unsigned int pos) return 0; } -static int ubifs_read(struct device_d *_dev, FILE *f, void *buf, size_t insize) +static int ubifs_read(struct device *_dev, FILE *f, void *buf, size_t insize) { struct ubifs_file *uf = f->priv; unsigned int pos = f->pos; @@ -451,7 +451,7 @@ static void ubifs_set_rootarg(struct ubifs_priv *priv, struct fs_device_d *fsdev free(str); } -static int ubifs_probe(struct device_d *dev) +static int ubifs_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct ubifs_priv *priv = xzalloc(sizeof(struct ubifs_priv)); @@ -488,7 +488,7 @@ err_free: return ret; } -static void ubifs_remove(struct device_d *dev) +static void ubifs_remove(struct device *dev) { struct ubifs_priv *priv = dev->priv; struct super_block *sb = priv->sb; diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index bffaa26fb3..598614efea 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1512,7 +1512,7 @@ struct ubifs_info { struct rb_root size_tree; struct ubifs_mount_opts mount_opts; - struct device_d *dev; + struct device *dev; struct ubifs_debug_info *dbg; }; @@ -2060,7 +2060,8 @@ int ubifs_decompress(const struct ubifs_info *c, const void *buf, int len, /* barebox specific */ void ubifs_umount(struct ubifs_info *c); /* barebox specific */ -int ubifs_get_super(struct device_d *dev, struct ubi_volume_desc *ubi, int silent); +int ubifs_get_super(struct device *dev, struct ubi_volume_desc *ubi, + int silent); #ifndef CONFIG_UBIFS_FS_ENCRYPTION static inline int ubifs_encrypt(const struct inode *inode, diff --git a/fs/ubootvarfs.c b/fs/ubootvarfs.c index 147fee1ea6..b70ad99e07 100644 --- a/fs/ubootvarfs.c +++ b/fs/ubootvarfs.c @@ -333,7 +333,7 @@ static const struct super_operations ubootvarfs_ops = { .destroy_inode = ubootvarfs_destroy_inode, }; -static int ubootvarfs_io(struct device_d *dev, FILE *f, void *buf, +static int ubootvarfs_io(struct device *dev, FILE *f, void *buf, size_t insize, bool read) { struct inode *inode = f->f_inode; @@ -348,19 +348,19 @@ static int ubootvarfs_io(struct device_d *dev, FILE *f, void *buf, return insize; } -static int ubootvarfs_read(struct device_d *dev, FILE *f, void *buf, +static int ubootvarfs_read(struct device *dev, FILE *f, void *buf, size_t insize) { return ubootvarfs_io(dev, f, buf, insize, true); } -static int ubootvarfs_write(struct device_d *dev, FILE *f, const void *buf, +static int ubootvarfs_write(struct device *dev, FILE *f, const void *buf, size_t insize) { return ubootvarfs_io(dev, f, (void *)buf, insize, false); } -static int ubootvarfs_truncate(struct device_d *dev, FILE *f, loff_t size) +static int ubootvarfs_truncate(struct device *dev, FILE *f, loff_t size) { struct inode *inode = f->f_inode; struct ubootvarfs_inode *node = inode_to_node(inode); @@ -423,7 +423,7 @@ static void ubootvarfs_parse(struct ubootvarfs_data *data, char *blob, data->end = blob; } -static int ubootvarfs_probe(struct device_d *dev) +static int ubootvarfs_probe(struct device *dev) { struct inode *inode; struct ubootvarfs_data *data = xzalloc(sizeof(*data)); @@ -472,7 +472,7 @@ free_data: return ret; } -static void ubootvarfs_remove(struct device_d *dev) +static void ubootvarfs_remove(struct device *dev) { struct ubootvarfs_data *data = dev->priv; diff --git a/fs/uimagefs.c b/fs/uimagefs.c index 8de2b8881f..0b7fed0f63 100644 --- a/fs/uimagefs.c +++ b/fs/uimagefs.c @@ -68,7 +68,7 @@ static struct uimagefs_handle_data *uimagefs_get_by_name( return NULL; } -static int uimagefs_open(struct device_d *dev, FILE *file, const char *filename) +static int uimagefs_open(struct device *dev, FILE *file, const char *filename) { struct uimagefs_handle *priv = dev->priv; struct uimagefs_handle_data *d; @@ -94,7 +94,7 @@ static int uimagefs_open(struct device_d *dev, FILE *file, const char *filename) return 0; } -static int uimagefs_close(struct device_d *dev, FILE *file) +static int uimagefs_close(struct device *dev, FILE *file) { struct uimagefs_handle_data *d = file->priv; @@ -103,7 +103,8 @@ static int uimagefs_close(struct device_d *dev, FILE *file) return 0; } -static int uimagefs_read(struct device_d *dev, FILE *file, void *buf, size_t insize) +static int uimagefs_read(struct device *dev, FILE *file, void *buf, + size_t insize) { struct uimagefs_handle_data *d = file->priv; @@ -115,7 +116,7 @@ static int uimagefs_read(struct device_d *dev, FILE *file, void *buf, size_t ins } } -static int uimagefs_lseek(struct device_d *dev, FILE *file, loff_t pos) +static int uimagefs_lseek(struct device *dev, FILE *file, loff_t pos) { struct uimagefs_handle_data *d = file->priv; @@ -127,7 +128,7 @@ static int uimagefs_lseek(struct device_d *dev, FILE *file, loff_t pos) return 0; } -static DIR *uimagefs_opendir(struct device_d *dev, const char *pathname) +static DIR *uimagefs_opendir(struct device *dev, const char *pathname) { struct uimagefs_handle *priv = dev->priv; DIR *dir; @@ -142,7 +143,7 @@ static DIR *uimagefs_opendir(struct device_d *dev, const char *pathname) return dir; } -static struct dirent *uimagefs_readdir(struct device_d *dev, DIR *dir) +static struct dirent *uimagefs_readdir(struct device *dev, DIR *dir) { struct uimagefs_handle *priv = dev->priv; struct uimagefs_handle_data *d = dir->priv; @@ -155,13 +156,14 @@ static struct dirent *uimagefs_readdir(struct device_d *dev, DIR *dir) return &dir->d; } -static int uimagefs_closedir(struct device_d *dev, DIR *dir) +static int uimagefs_closedir(struct device *dev, DIR *dir) { free(dir); return 0; } -static int uimagefs_stat(struct device_d *dev, const char *filename, struct stat *s) +static int uimagefs_stat(struct device *dev, const char *filename, + struct stat *s) { struct uimagefs_handle *priv = dev->priv; struct uimagefs_handle_data *d; @@ -179,7 +181,7 @@ static int uimagefs_stat(struct device_d *dev, const char *filename, struct stat return 0; } -static int uimagefs_ioctl(struct device_d *dev, FILE *f, int request, void *buf) +static int uimagefs_ioctl(struct device *dev, FILE *f, int request, void *buf) { struct uimagefs_handle *priv = dev->priv; @@ -191,7 +193,7 @@ static int uimagefs_ioctl(struct device_d *dev, FILE *f, int request, void *buf) return 0; } -static void uimagefs_remove(struct device_d *dev) +static void uimagefs_remove(struct device *dev) { struct uimagefs_handle *priv = dev->priv; struct uimagefs_handle_data *d, *tmp; @@ -493,7 +495,7 @@ err_out: return ret; } -static int uimagefs_probe(struct device_d *dev) +static int uimagefs_probe(struct device *dev) { struct fs_device_d *fsdev = dev_to_fs_device(dev); struct uimagefs_handle *priv; -- cgit v1.2.1