summaryrefslogtreecommitdiff
path: root/drivers/auxdisplay/ht16k33.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-02-19 19:58:01 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-02-26 19:02:19 +0300
commit4ce026d5f4ccb89a493b7c57d87d53a3ccb0be59 (patch)
treec56d57ae8f08f3a0ca23de348ac9ddef0b255e1a /drivers/auxdisplay/ht16k33.c
parent34ddc83dc72030ded90b5ff038cca67354ea8d34 (diff)
downloadlinux-4ce026d5f4ccb89a493b7c57d87d53a3ccb0be59.tar.xz
auxdisplay: linedisp: Allocate buffer for the string
Always allocate a buffer for the currently displayed characters. It makes the line display API simpler. Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/auxdisplay/ht16k33.c')
-rw-r--r--drivers/auxdisplay/ht16k33.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index 32d3afd29177..19805f39a257 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -92,7 +92,6 @@ struct ht16k33_seg {
struct seg14_conversion_map seg14;
} map;
unsigned int map_size;
- char curr[4];
};
struct ht16k33_priv {
@@ -457,7 +456,7 @@ static void ht16k33_seg7_update(struct work_struct *work)
struct ht16k33_priv *priv = container_of(work, struct ht16k33_priv,
work.work);
struct ht16k33_seg *seg = &priv->seg;
- char *s = seg->curr;
+ char *s = seg->linedisp.buf;
uint8_t buf[9];
buf[0] = map_to_seg7(&seg->map.seg7, *s++);
@@ -478,7 +477,7 @@ static void ht16k33_seg14_update(struct work_struct *work)
struct ht16k33_priv *priv = container_of(work, struct ht16k33_priv,
work.work);
struct ht16k33_seg *seg = &priv->seg;
- char *s = seg->curr;
+ char *s = seg->linedisp.buf;
uint8_t buf[8];
put_unaligned_le16(map_to_seg14(&seg->map.seg14, *s++), buf);
@@ -700,8 +699,7 @@ static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv,
if (err)
return err;
- err = linedisp_register(&seg->linedisp, dev, 4, seg->curr,
- &ht16k33_linedisp_ops);
+ err = linedisp_register(&seg->linedisp, dev, 4, &ht16k33_linedisp_ops);
if (err)
goto err_remove_map_file;