Commit 85d93b16 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Miguel Ojeda

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: default avatarRobin van der Gracht <robin@protonic.nl>
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent d08a44d8
...@@ -65,11 +65,11 @@ struct ht16k33_fbdev { ...@@ -65,11 +65,11 @@ struct ht16k33_fbdev {
uint32_t refresh_rate; uint32_t refresh_rate;
uint8_t *buffer; uint8_t *buffer;
uint8_t *cache; uint8_t *cache;
struct delayed_work work;
}; };
struct ht16k33_priv { struct ht16k33_priv {
struct i2c_client *client; struct i2c_client *client;
struct delayed_work work;
struct ht16k33_keypad keypad; struct ht16k33_keypad keypad;
struct ht16k33_fbdev fbdev; struct ht16k33_fbdev fbdev;
}; };
...@@ -117,7 +117,7 @@ static void ht16k33_fb_queue(struct ht16k33_priv *priv) ...@@ -117,7 +117,7 @@ static void ht16k33_fb_queue(struct ht16k33_priv *priv)
{ {
struct ht16k33_fbdev *fbdev = &priv->fbdev; 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) ...@@ -125,10 +125,9 @@ static void ht16k33_fb_queue(struct ht16k33_priv *priv)
*/ */
static void ht16k33_fb_update(struct work_struct *work) static void ht16k33_fb_update(struct work_struct *work)
{ {
struct ht16k33_fbdev *fbdev = struct ht16k33_priv *priv = container_of(work, struct ht16k33_priv,
container_of(work, struct ht16k33_fbdev, work.work); work.work);
struct ht16k33_priv *priv = struct ht16k33_fbdev *fbdev = &priv->fbdev;
container_of(fbdev, struct ht16k33_priv, fbdev);
uint8_t *p1, *p2; uint8_t *p1, *p2;
int len, pos = 0, first = -1; int len, pos = 0, first = -1;
...@@ -472,7 +471,7 @@ static int ht16k33_probe(struct i2c_client *client) ...@@ -472,7 +471,7 @@ static int ht16k33_probe(struct i2c_client *client)
} }
fb_bl_default_curve(fbdev->info, 0, MIN_BRIGHTNESS, MAX_BRIGHTNESS); 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->fbops = &ht16k33_fb_ops;
fbdev->info->screen_base = (char __iomem *) fbdev->buffer; fbdev->info->screen_base = (char __iomem *) fbdev->buffer;
fbdev->info->screen_size = HT16K33_FB_SIZE; fbdev->info->screen_size = HT16K33_FB_SIZE;
...@@ -512,7 +511,7 @@ static int ht16k33_remove(struct i2c_client *client) ...@@ -512,7 +511,7 @@ static int ht16k33_remove(struct i2c_client *client)
struct ht16k33_priv *priv = i2c_get_clientdata(client); struct ht16k33_priv *priv = i2c_get_clientdata(client);
struct ht16k33_fbdev *fbdev = &priv->fbdev; struct ht16k33_fbdev *fbdev = &priv->fbdev;
cancel_delayed_work_sync(&fbdev->work); cancel_delayed_work_sync(&priv->work);
unregister_framebuffer(fbdev->info); unregister_framebuffer(fbdev->info);
framebuffer_release(fbdev->info); framebuffer_release(fbdev->info);
free_page((unsigned long) fbdev->buffer); free_page((unsigned long) fbdev->buffer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment