summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 553766a..226eadf 100644
--- a/memory.c
+++ b/memory.c
@@ -27,6 +27,16 @@ void memory_set_byte(struct memory *mem, int32_t addr, uint8_t data)
base[addr - mem->image_base] = data;
}
+uint16_t memory_get_halfword(struct memory *mem, int32_t addr)
+{
+ return mem->base[(addr - mem->image_base) / 2];
+}
+
+void memory_set_halfword(struct memory *mem, int32_t addr, uint16_t data)
+{
+ mem->base[(addr - mem->image_base) / 2] = data;
+}
+
uint32_t memory_get_word(struct memory *mem, int32_t addr)
{
return mem->base[(addr - mem->image_base) / 4];
n. The class device is registered when a gpio-chip is added (or from gpiolib_sysfs_init post-core init call), and deregistered when the chip is removed. Store the class device in struct gpio_chip directly rather than do a class-device lookup on deregistration. This also removes the need for the exported flag. Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-sysfs.c')