Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvmem: Create a header for internal sharing

Before adding all the NVMEM layout bus infrastructure to the core, let's
move the main nvmem_device structure in an internal header, only
available to the core. This way all the additional code can be added in
a dedicated file in order to keep the current core file tidy.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20231215111536.316972-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Miquel Raynal and committed by
Greg Kroah-Hartman
ec9c08a1 4a1a4023

+36 -23
+1 -23
drivers/nvmem/core.c
··· 19 19 #include <linux/of.h> 20 20 #include <linux/slab.h> 21 21 22 - struct nvmem_device { 23 - struct module *owner; 24 - struct device dev; 25 - int stride; 26 - int word_size; 27 - int id; 28 - struct kref refcnt; 29 - size_t size; 30 - bool read_only; 31 - bool root_only; 32 - int flags; 33 - enum nvmem_type type; 34 - struct bin_attribute eeprom; 35 - struct device *base_dev; 36 - struct list_head cells; 37 - const struct nvmem_keepout *keepout; 38 - unsigned int nkeepout; 39 - nvmem_reg_read_t reg_read; 40 - nvmem_reg_write_t reg_write; 41 - struct gpio_desc *wp_gpio; 42 - struct nvmem_layout *layout; 43 - void *priv; 44 - }; 22 + #include "internals.h" 45 23 46 24 #define to_nvmem_device(d) container_of(d, struct nvmem_device, dev) 47 25
+35
drivers/nvmem/internals.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef _LINUX_NVMEM_INTERNALS_H 4 + #define _LINUX_NVMEM_INTERNALS_H 5 + 6 + #include <linux/device.h> 7 + #include <linux/nvmem-consumer.h> 8 + #include <linux/nvmem-provider.h> 9 + 10 + struct nvmem_device { 11 + struct module *owner; 12 + struct device dev; 13 + struct list_head node; 14 + int stride; 15 + int word_size; 16 + int id; 17 + struct kref refcnt; 18 + size_t size; 19 + bool read_only; 20 + bool root_only; 21 + int flags; 22 + enum nvmem_type type; 23 + struct bin_attribute eeprom; 24 + struct device *base_dev; 25 + struct list_head cells; 26 + const struct nvmem_keepout *keepout; 27 + unsigned int nkeepout; 28 + nvmem_reg_read_t reg_read; 29 + nvmem_reg_write_t reg_write; 30 + struct gpio_desc *wp_gpio; 31 + struct nvmem_layout *layout; 32 + void *priv; 33 + }; 34 + 35 + #endif /* ifndef _LINUX_NVMEM_INTERNALS_H */