summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2021-10-19 17:45:14 +0300
committerMiguel Ojeda <ojeda@kernel.org>2021-10-22 00:36:29 +0300
commit85d93b165f81ffb93745325efdf3df2b2df1a0e6 (patch)
tree54faee8101dff7eedc933d2632b8cbedb70e6f51
parentd08a44d86f9e5533eda39b5a4bbea9ecf960dfe3 (diff)
downloadlinux-85d93b165f81ffb93745325efdf3df2b2df1a0e6.tar.xz
auxdisplay: ht16k33: Move delayed work
Move delayed_work from ht16k33_fbdev to ht16k33_priv, as it is not specific to dot-matrix displays, but common to all display types. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
-rw-r--r--drivers/auxdisplay/ht16k33.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index dcf530a9390b..b50cbf7e57ba 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -65,11 +65,11 @@ struct ht16k33_fbdev {
uint32_t refresh_rate;
uint8_t *buffer;
uint8_t *cache;
- struct delayed_work work;
};
struct ht16k33_priv {
struct i2c_client *client;
+ struct delayed_work work;
struct ht16k33_keypad keypad;
struct ht16k33_fbdev fbdev;
};
@@ -117,7 +117,7 @@ static void ht16k33_fb_queue(struct ht16k33_priv *priv)
{
struct ht16k33_fbdev *fbdev = &priv->fbdev;
- schedule_delayed_work(&fbdev->work, HZ / fbdev->refresh_rate);
+ schedule_delayed_work(&priv->work, HZ / fbdev->refresh_rate);
}
/*
@@ -125,10 +125,9 @@ static void ht16k33_fb_queue(struct ht16k33_priv *priv)
*/
static void ht16k33_fb_update(struct work_struct *work)
{
- struct ht16k33_fbdev *fbdev =
- container_of(work, struct ht16k33_fbdev, work.work);
- struct ht16k33_priv *priv =
- container_of(fbdev, struct ht16k33_priv, fbdev);
+ struct ht16k33_priv *priv = container_of(work, struct ht16k33_priv,
+ work.work);
+ struct ht16k33_fbdev *fbdev = &priv->fbdev;
uint8_t *p1, *p2;
int len, pos = 0, first = -1;
@@ -472,7 +471,7 @@ static int ht16k33_probe(struct i2c_client *client)
}
fb_bl_default_curve(fbdev->info, 0, MIN_BRIGHTNESS, MAX_BRIGHTNESS);
- INIT_DELAYED_WORK(&fbdev->work, ht16k33_fb_update);
+ INIT_DELAYED_WORK(&priv->work, ht16k33_fb_update);
fbdev->info->fbops = &ht16k33_fb_ops;
fbdev->info->screen_base = (char __iomem *) fbdev->buffer;
fbdev->info->screen_size = HT16K33_FB_SIZE;
@@ -512,7 +511,7 @@ static int ht16k33_remove(struct i2c_client *client)
struct ht16k33_priv *priv = i2c_get_clientdata(client);
struct ht16k33_fbdev *fbdev = &priv->fbdev;
- cancel_delayed_work_sync(&fbdev->work);
+ cancel_delayed_work_sync(&priv->work);
unregister_framebuffer(fbdev->info);
framebuffer_release(fbdev->info);
free_page((unsigned long) fbdev->buffer);