OSDN Git Service

auxdisplay: charlcd: Introduce charlcd_free() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 12 Mar 2019 14:44:30 +0000 (16:44 +0200)
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Sun, 17 Mar 2019 07:48:16 +0000 (08:48 +0100)
The charlcd_free() is a counterpart to charlcd_alloc()
and should be called symmetrically on tear down.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
drivers/auxdisplay/charlcd.c
include/misc/charlcd.h

index 407acd2..a351a94 100644 (file)
@@ -818,6 +818,12 @@ struct charlcd *charlcd_alloc(unsigned int drvdata_size)
 }
 EXPORT_SYMBOL_GPL(charlcd_alloc);
 
+void charlcd_free(struct charlcd *lcd)
+{
+       kfree(charlcd_to_priv(lcd));
+}
+EXPORT_SYMBOL_GPL(charlcd_free);
+
 static int panel_notify_sys(struct notifier_block *this, unsigned long code,
                            void *unused)
 {
index 23f6185..1832402 100644 (file)
@@ -35,6 +35,7 @@ struct charlcd_ops {
 };
 
 struct charlcd *charlcd_alloc(unsigned int drvdata_size);
+void charlcd_free(struct charlcd *lcd);
 
 int charlcd_register(struct charlcd *lcd);
 int charlcd_unregister(struct charlcd *lcd);