tty: goldfish: move gf_write_ptr() to tty/goldfish.c

tty/goldfish.c is the only user of gf_write_ptr(). Move it there, drop
the unneeded casts, and name it appropriately.

FTR, the last non-tty user was removed in 2018 by 4ae0fe70a0 ("Delete
the goldfish_nand driver.").

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://patch.msgid.link/20260703084717.176442-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiri Slaby (SUSE)
2026-07-03 10:47:16 +02:00
committed by Greg Kroah-Hartman
parent e2dcf364de
commit e31bd02f19
2 changed files with 11 additions and 15 deletions

View File

@@ -18,6 +18,7 @@
#include <linux/mm.h>
#include <linux/dma-mapping.h>
#include <linux/serial_core.h>
#include <linux/wordpart.h>
/* Goldfish tty register's offsets */
#define GOLDFISH_TTY_REG_BYTES_READY 0x04
@@ -49,6 +50,14 @@ static u32 goldfish_tty_line_count = 8;
static u32 goldfish_tty_current_line_count;
static struct goldfish_tty *goldfish_ttys;
static inline void gf_write_addr(unsigned long addr, void __iomem *portl, void __iomem *porth)
{
gf_iowrite32(lower_32_bits(addr), portl);
#ifdef CONFIG_64BIT
gf_iowrite32(upper_32_bits(addr), porth);
#endif
}
static void do_rw_io(struct goldfish_tty *qtty, unsigned long address,
size_t count, bool is_write)
{
@@ -56,8 +65,8 @@ static void do_rw_io(struct goldfish_tty *qtty, unsigned long address,
void __iomem *base = qtty->base;
spin_lock_irqsave(&qtty->lock, irq_flags);
gf_write_ptr((void *)address, base + GOLDFISH_TTY_REG_DATA_PTR,
base + GOLDFISH_TTY_REG_DATA_PTR_HIGH);
gf_write_addr(address, base + GOLDFISH_TTY_REG_DATA_PTR,
base + GOLDFISH_TTY_REG_DATA_PTR_HIGH);
gf_iowrite32(count, base + GOLDFISH_TTY_REG_DATA_LEN);
if (is_write)

View File

@@ -2,8 +2,6 @@
#ifndef __LINUX_GOLDFISH_H
#define __LINUX_GOLDFISH_H
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/io.h>
/* Helpers for Goldfish virtual platform */
@@ -15,15 +13,4 @@
#define gf_iowrite32 iowrite32
#endif
static inline void gf_write_ptr(const void *ptr, void __iomem *portl,
void __iomem *porth)
{
const unsigned long addr = (unsigned long)ptr;
gf_iowrite32(lower_32_bits(addr), portl);
#ifdef CONFIG_64BIT
gf_iowrite32(upper_32_bits(addr), porth);
#endif
}
#endif /* __LINUX_GOLDFISH_H */