From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>,
Willy Tarreau <willy@haproxy.com>,
linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/4] auxdisplay: charlcd: Introduce charlcd_free() helper
Date: Tue, 12 Mar 2019 15:18:28 +0200 [thread overview]
Message-ID: <20190312131830.4253-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20190312131830.4253-1-andriy.shevchenko@linux.intel.com>
The charlcd_free() is a counterpart to charlcd_alloc()
and should be called symmetrically on tear down.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/auxdisplay/charlcd.c | 6 ++++++
include/misc/charlcd.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 60e0b772673f..882be08ddad5 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -818,6 +818,12 @@ struct charlcd *charlcd_alloc(unsigned int drvdata_size)
}
EXPORT_SYMBOL_GPL(charlcd_alloc);
+void charlcd_free(struct charlcd *lcd)
+{
+ kfree(lcd);
+}
+EXPORT_SYMBOL_GPL(charlcd_free);
+
static int panel_notify_sys(struct notifier_block *this, unsigned long code,
void *unused)
{
diff --git a/include/misc/charlcd.h b/include/misc/charlcd.h
index 23f61850f363..1832402324ce 100644
--- a/include/misc/charlcd.h
+++ b/include/misc/charlcd.h
@@ -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);
--
2.20.1
next prev parent reply other threads:[~2019-03-12 13:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-12 13:18 [PATCH v1 1/4] auxdisplay: hd44780: Fix memory leak on ->remove() Andy Shevchenko
2019-03-12 13:18 ` Andy Shevchenko [this message]
2019-03-12 13:18 ` [PATCH v1 3/4] auxdisplay: panel: Convert to use charlcd_free() Andy Shevchenko
2019-03-12 13:18 ` [PATCH v1 4/4] auxdisplay: hd44780: " Andy Shevchenko
2019-03-12 13:47 ` [PATCH v1 1/4] auxdisplay: hd44780: Fix memory leak on ->remove() Geert Uytterhoeven
2019-03-12 14:40 ` Andy Shevchenko
2019-03-12 15:04 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190312131830.4253-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=willy@haproxy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox