linux-next/drivers/auxdisplay/hd44780_common.c
Lars Poeschel 3fc04dd7eb auxdisplay: Move ifwidth to struct hd44780_common
Move struct charlcd member ifwidth to our new struct hd44780_common.
ifwidth is hd44780 device specific and is used by two drivers at the
moment, so we move it to a common place, where both can use this.

Reviewed-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2020-11-04 11:04:02 +01:00

23 lines
437 B
C

// SPDX-License-Identifier: GPL-2.0-or-later
#include <linux/module.h>
#include <linux/slab.h>
#include "hd44780_common.h"
struct hd44780_common *hd44780_common_alloc(void)
{
struct hd44780_common *hd;
hd = kzalloc(sizeof(*hd), GFP_KERNEL);
if (!hd)
return NULL;
hd->ifwidth = 8;
hd->bwidth = DEFAULT_LCD_BWIDTH;
hd->hwidth = DEFAULT_LCD_HWIDTH;
return hd;
}
EXPORT_SYMBOL_GPL(hd44780_common_alloc);
MODULE_LICENSE("GPL");