[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240219170337.2161754-8-andriy.shevchenko@linux.intel.com>
Date: Mon, 19 Feb 2024 18:58:06 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <andy@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Robin van der Gracht <robin@...tonic.nl>,
Paul Burton <paulburton@...nel.org>
Subject: [PATCH v3 7/9] auxdisplay: ht16k33: Drop struct ht16k33_seg
The struct ht16k33_seg is repeating struct linedisp. Use the latter
directly.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/auxdisplay/ht16k33.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index 41a961342dc3..96acfb2b58cd 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -86,10 +86,6 @@ struct ht16k33_fbdev {
uint8_t *cache;
};
-struct ht16k33_seg {
- struct linedisp linedisp;
-};
-
struct ht16k33_priv {
struct i2c_client *client;
struct delayed_work work;
@@ -97,7 +93,7 @@ struct ht16k33_priv {
struct ht16k33_keypad keypad;
union {
struct ht16k33_fbdev fbdev;
- struct ht16k33_seg seg;
+ struct linedisp linedisp;
};
enum display_type type;
uint8_t blink;
@@ -110,7 +106,7 @@ struct ht16k33_priv {
container_of(p, struct ht16k33_priv, led)
#define ht16k33_linedisp_to_priv(p) \
- container_of(p, struct ht16k33_priv, seg.linedisp)
+ container_of(p, struct ht16k33_priv, linedisp)
static const struct fb_fix_screeninfo ht16k33_fb_fix = {
.id = DRIVER_NAME,
@@ -417,9 +413,8 @@ static void ht16k33_keypad_stop(struct input_dev *dev)
static void ht16k33_seg7_update(struct work_struct *work)
{
struct ht16k33_priv *priv = ht16k33_work_to_priv(work);
- struct ht16k33_seg *seg = &priv->seg;
- struct linedisp_map *map = seg->linedisp.map;
- char *s = seg->linedisp.buf;
+ struct linedisp_map *map = priv->linedisp.map;
+ char *s = priv->linedisp.buf;
uint8_t buf[9];
buf[0] = map_to_seg7(&map->map.seg7, *s++);
@@ -438,9 +433,8 @@ static void ht16k33_seg7_update(struct work_struct *work)
static void ht16k33_seg14_update(struct work_struct *work)
{
struct ht16k33_priv *priv = ht16k33_work_to_priv(work);
- struct ht16k33_seg *seg = &priv->seg;
- struct linedisp_map *map = seg->linedisp.map;
- char *s = seg->linedisp.buf;
+ struct linedisp_map *map = priv->linedisp.map;
+ char *s = priv->linedisp.buf;
uint8_t buf[8];
put_unaligned_le16(map_to_seg14(&map->map.seg14, *s++), buf + 0);
@@ -662,14 +656,14 @@ static int ht16k33_fbdev_probe(struct device *dev, struct ht16k33_priv *priv,
static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv,
uint32_t brightness)
{
- struct ht16k33_seg *seg = &priv->seg;
+ struct linedisp *linedisp = &priv->linedisp;
int err;
err = ht16k33_brightness_set(priv, brightness);
if (err)
return err;
- return linedisp_register(&seg->linedisp, dev, 4, &ht16k33_linedisp_ops);
+ return linedisp_register(linedisp, dev, 4, &ht16k33_linedisp_ops);
}
static int ht16k33_probe(struct i2c_client *client)
@@ -756,7 +750,7 @@ static void ht16k33_remove(struct i2c_client *client)
case DISP_QUAD_7SEG:
case DISP_QUAD_14SEG:
- linedisp_unregister(&priv->seg.linedisp);
+ linedisp_unregister(&priv->linedisp);
break;
default:
--
2.43.0.rc1.1.gbec44491f096
Powered by blists - more mailing lists