Commit b658a211 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Miguel Ojeda

auxdisplay: charlcd: Move to_priv() to charlcd namespace

In order to be more particular in names, rename to_priv() macro
to charlcd_to_priv().

No functional change intended.
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
parent 41c8d0ad
...@@ -91,7 +91,7 @@ struct charlcd_priv { ...@@ -91,7 +91,7 @@ struct charlcd_priv {
unsigned long long drvdata[0]; unsigned long long drvdata[0];
}; };
#define to_priv(p) container_of(p, struct charlcd_priv, lcd) #define charlcd_to_priv(p) container_of(p, struct charlcd_priv, lcd)
/* Device single-open policy control */ /* Device single-open policy control */
static atomic_t charlcd_available = ATOMIC_INIT(1); static atomic_t charlcd_available = ATOMIC_INIT(1);
...@@ -105,7 +105,7 @@ static void long_sleep(int ms) ...@@ -105,7 +105,7 @@ static void long_sleep(int ms)
/* turn the backlight on or off */ /* turn the backlight on or off */
static void charlcd_backlight(struct charlcd *lcd, int on) static void charlcd_backlight(struct charlcd *lcd, int on)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
if (!lcd->ops->backlight) if (!lcd->ops->backlight)
return; return;
...@@ -134,7 +134,7 @@ static void charlcd_bl_off(struct work_struct *work) ...@@ -134,7 +134,7 @@ static void charlcd_bl_off(struct work_struct *work)
/* turn the backlight on for a little while */ /* turn the backlight on for a little while */
void charlcd_poke(struct charlcd *lcd) void charlcd_poke(struct charlcd *lcd)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
if (!lcd->ops->backlight) if (!lcd->ops->backlight)
return; return;
...@@ -152,7 +152,7 @@ EXPORT_SYMBOL_GPL(charlcd_poke); ...@@ -152,7 +152,7 @@ EXPORT_SYMBOL_GPL(charlcd_poke);
static void charlcd_gotoxy(struct charlcd *lcd) static void charlcd_gotoxy(struct charlcd *lcd)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
unsigned int addr; unsigned int addr;
/* /*
...@@ -170,7 +170,7 @@ static void charlcd_gotoxy(struct charlcd *lcd) ...@@ -170,7 +170,7 @@ static void charlcd_gotoxy(struct charlcd *lcd)
static void charlcd_home(struct charlcd *lcd) static void charlcd_home(struct charlcd *lcd)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
priv->addr.x = 0; priv->addr.x = 0;
priv->addr.y = 0; priv->addr.y = 0;
...@@ -179,7 +179,7 @@ static void charlcd_home(struct charlcd *lcd) ...@@ -179,7 +179,7 @@ static void charlcd_home(struct charlcd *lcd)
static void charlcd_print(struct charlcd *lcd, char c) static void charlcd_print(struct charlcd *lcd, char c)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
if (priv->addr.x < lcd->bwidth) { if (priv->addr.x < lcd->bwidth) {
if (lcd->char_conv) if (lcd->char_conv)
...@@ -211,7 +211,7 @@ static void charlcd_clear_fast(struct charlcd *lcd) ...@@ -211,7 +211,7 @@ static void charlcd_clear_fast(struct charlcd *lcd)
/* clears the display and resets X/Y */ /* clears the display and resets X/Y */
static void charlcd_clear_display(struct charlcd *lcd) static void charlcd_clear_display(struct charlcd *lcd)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
lcd->ops->write_cmd(lcd, LCD_CMD_DISPLAY_CLEAR); lcd->ops->write_cmd(lcd, LCD_CMD_DISPLAY_CLEAR);
priv->addr.x = 0; priv->addr.x = 0;
...@@ -223,7 +223,7 @@ static void charlcd_clear_display(struct charlcd *lcd) ...@@ -223,7 +223,7 @@ static void charlcd_clear_display(struct charlcd *lcd)
static int charlcd_init_display(struct charlcd *lcd) static int charlcd_init_display(struct charlcd *lcd)
{ {
void (*write_cmd_raw)(struct charlcd *lcd, int cmd); void (*write_cmd_raw)(struct charlcd *lcd, int cmd);
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
u8 init; u8 init;
if (lcd->ifwidth != 4 && lcd->ifwidth != 8) if (lcd->ifwidth != 4 && lcd->ifwidth != 8)
...@@ -369,7 +369,7 @@ static bool parse_xy(const char *s, unsigned long *x, unsigned long *y) ...@@ -369,7 +369,7 @@ static bool parse_xy(const char *s, unsigned long *x, unsigned long *y)
static inline int handle_lcd_special_code(struct charlcd *lcd) static inline int handle_lcd_special_code(struct charlcd *lcd)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
/* LCD special codes */ /* LCD special codes */
...@@ -580,7 +580,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) ...@@ -580,7 +580,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
static void charlcd_write_char(struct charlcd *lcd, char c) static void charlcd_write_char(struct charlcd *lcd, char c)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
/* first, we'll test if we're in escape mode */ /* first, we'll test if we're in escape mode */
if ((c != '\n') && priv->esc_seq.len >= 0) { if ((c != '\n') && priv->esc_seq.len >= 0) {
...@@ -705,7 +705,7 @@ static ssize_t charlcd_write(struct file *file, const char __user *buf, ...@@ -705,7 +705,7 @@ static ssize_t charlcd_write(struct file *file, const char __user *buf,
static int charlcd_open(struct inode *inode, struct file *file) static int charlcd_open(struct inode *inode, struct file *file)
{ {
struct charlcd_priv *priv = to_priv(the_charlcd); struct charlcd_priv *priv = charlcd_to_priv(the_charlcd);
int ret; int ret;
ret = -EBUSY; ret = -EBUSY;
...@@ -766,7 +766,7 @@ static void charlcd_puts(struct charlcd *lcd, const char *s) ...@@ -766,7 +766,7 @@ static void charlcd_puts(struct charlcd *lcd, const char *s)
/* initialize the LCD driver */ /* initialize the LCD driver */
static int charlcd_init(struct charlcd *lcd) static int charlcd_init(struct charlcd *lcd)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
int ret; int ret;
if (lcd->ops->backlight) { if (lcd->ops->backlight) {
...@@ -866,7 +866,7 @@ EXPORT_SYMBOL_GPL(charlcd_register); ...@@ -866,7 +866,7 @@ EXPORT_SYMBOL_GPL(charlcd_register);
int charlcd_unregister(struct charlcd *lcd) int charlcd_unregister(struct charlcd *lcd)
{ {
struct charlcd_priv *priv = to_priv(lcd); struct charlcd_priv *priv = charlcd_to_priv(lcd);
unregister_reboot_notifier(&panel_notifier); unregister_reboot_notifier(&panel_notifier);
charlcd_puts(lcd, "\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-"); charlcd_puts(lcd, "\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-");
......
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