summaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay/panel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/auxdisplay/panel.c')
-rw-r--r--drivers/auxdisplay/panel.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
index de623ae219f1..c3a60e190a7a 100644
--- a/drivers/auxdisplay/panel.c
+++ b/drivers/auxdisplay/panel.c
@@ -56,6 +56,7 @@
#include <linux/uaccess.h>
#include "charlcd.h"
+#include "hd44780_common.h"
#define LCD_MAXBYTES 256 /* max burst write */
@@ -895,10 +896,20 @@ static const struct charlcd_ops charlcd_tilcd_ops = {
static void lcd_init(void)
{
struct charlcd *charlcd;
+ struct hd44780_common *hdc;
+
+ hdc = hd44780_common_alloc();
+ if (!hdc)
+ return;
charlcd = charlcd_alloc(0);
- if (!charlcd)
+ if (!charlcd) {
+ kfree(hdc);
return;
+ }
+
+ hdc->hd44780 = &lcd;
+ charlcd->drvdata = hdc;
/*
* Init lcd struct with load-time values to preserve exact
@@ -1620,7 +1631,7 @@ err_lcd_unreg:
if (lcd.enabled)
charlcd_unregister(lcd.charlcd);
err_unreg_device:
- charlcd_free(lcd.charlcd);
+ kfree(lcd.charlcd);
lcd.charlcd = NULL;
parport_unregister_device(pprt);
pprt = NULL;
@@ -1647,7 +1658,8 @@ static void panel_detach(struct parport *port)
if (lcd.enabled) {
charlcd_unregister(lcd.charlcd);
lcd.initialized = false;
- charlcd_free(lcd.charlcd);
+ kfree(lcd.charlcd->drvdata);
+ kfree(lcd.charlcd);
lcd.charlcd = NULL;
}