diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/bug.h | 12 | ||||
-rw-r--r-- | include/driver.h | 22 | ||||
-rw-r--r-- | include/filetype.h | 1 | ||||
-rw-r--r-- | include/linux/compiler_types.h | 4 |
4 files changed, 33 insertions, 6 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index f20e1b4d65..5d0a458eae 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -50,4 +50,16 @@ } \ unlikely(__ret_warn_once); \ }) + +#define WARN_ON_ONCE(condition) ({ \ + static int __warned; \ + int __ret_warn_once = !!(condition); \ + \ + if (unlikely(__ret_warn_once && !__warned)) { \ + __warned = 1; \ + __WARN(); \ + } \ + unlikely(__ret_warn_once); \ +}) + #endif diff --git a/include/driver.h b/include/driver.h index 1215a2d57a..a787f985a0 100644 --- a/include/driver.h +++ b/include/driver.h @@ -141,6 +141,10 @@ void device_detect_all(void); */ int unregister_device(struct device_d *); +void free_device_res(struct device_d *dev); +void free_device(struct device_d *dev); + + /* Iterate over a devices children */ #define device_for_each_child(dev, child) \ @@ -451,7 +455,7 @@ struct cdev_operations { int (*truncate)(struct cdev*, size_t size); }; -#define MAX_PARTUUID_STR sizeof("00112233-4455-6677-8899-AABBCCDDEEFF") +#define MAX_UUID_STR sizeof("00112233-4455-6677-8899-AABBCCDDEEFF") struct cdev { const struct cdev_operations *ops; @@ -464,7 +468,7 @@ struct cdev { char *partname; /* the partition name, usually the above without the * device part, i.e. name = "nand0.barebox" -> partname = "barebox" */ - char partuuid[MAX_PARTUUID_STR]; + char uuid[MAX_UUID_STR]; loff_t offset; loff_t size; unsigned int flags; @@ -488,18 +492,28 @@ struct cdev *lcdev_by_name(const char *filename); struct cdev *cdev_readlink(struct cdev *cdev); struct cdev *cdev_by_device_node(struct device_node *node); struct cdev *cdev_by_partuuid(const char *partuuid); -struct cdev *cdev_open(const char *name, unsigned long flags); +struct cdev *cdev_by_diskuuid(const char *partuuid); +struct cdev *cdev_open_by_name(const char *name, unsigned long flags); struct cdev *cdev_create_loop(const char *path, ulong flags, loff_t offset); void cdev_remove_loop(struct cdev *cdev); -int cdev_do_open(struct cdev *, unsigned long flags); +int cdev_open(struct cdev *, unsigned long flags); void cdev_close(struct cdev *cdev); int cdev_flush(struct cdev *cdev); ssize_t cdev_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulong flags); ssize_t cdev_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, ulong flags); int cdev_ioctl(struct cdev *cdev, int cmd, void *buf); int cdev_erase(struct cdev *cdev, loff_t count, loff_t offset); +int cdev_lseek(struct cdev*, loff_t); +int cdev_protect(struct cdev*, size_t count, loff_t offset, int prot); +int cdev_discard_range(struct cdev*, loff_t count, loff_t offset); +int cdev_memmap(struct cdev*, void **map, int flags); +int cdev_truncate(struct cdev*, size_t size); loff_t cdev_unallocated_space(struct cdev *cdev); +extern struct list_head cdev_list; +#define for_each_cdev(c) \ + list_for_each_entry(cdev, &cdev_list, list) + #define DEVFS_PARTITION_FIXED (1U << 0) #define DEVFS_PARTITION_READONLY (1U << 1) #define DEVFS_IS_CHARACTER_DEV (1U << 3) diff --git a/include/filetype.h b/include/filetype.h index 2640847e1f..8bc179ac08 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -28,6 +28,7 @@ enum filetype { filetype_mbr, filetype_bmp, filetype_png, + filetype_qoi, filetype_ext, filetype_gpt, filetype_ubifs, diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 9a5a6f0e8b..aa9cbcac77 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -201,8 +201,8 @@ struct ftrace_likely_data { #define __pure __attribute__((pure)) #define __aligned(x) __attribute__((aligned(x))) #define __aligned_largest __attribute__((aligned)) -#define __printf(a, b) __attribute__((format(printf, a, b))) -#define __scanf(a, b) __attribute__((format(scanf, a, b))) +#define __printf(a, b) __attribute__((format(__printf__, a, b))) +#define __scanf(a, b) __attribute__((format(__scanf__, a, b))) #define __maybe_unused __attribute__((unused)) #define __always_unused __attribute__((unused)) #define __mode(x) __attribute__((mode(x))) |