diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-03-12 10:44:29 -0400 |
|---|---|---|
| committer | Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> | 2019-03-17 03:48:10 -0400 |
| commit | b658a2113ba4d4b99e2a57926379b0c0b0c648ab (patch) | |
| tree | 1e8d2434d947a815cda73457c42b2f2b478186a0 | |
| parent | 41c8d0adf3c4df1867d98cee4a2c4531352a33ad (diff) | |
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: 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>
| -rw-r--r-- | drivers/auxdisplay/charlcd.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 60e0b772673f..407acd22efa8 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c | |||
| @@ -91,7 +91,7 @@ struct charlcd_priv { | |||
| 91 | unsigned long long drvdata[0]; | 91 | unsigned long long drvdata[0]; |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | #define to_priv(p) container_of(p, struct charlcd_priv, lcd) | 94 | #define charlcd_to_priv(p) container_of(p, struct charlcd_priv, lcd) |
| 95 | 95 | ||
| 96 | /* Device single-open policy control */ | 96 | /* Device single-open policy control */ |
| 97 | static atomic_t charlcd_available = ATOMIC_INIT(1); | 97 | static atomic_t charlcd_available = ATOMIC_INIT(1); |
| @@ -105,7 +105,7 @@ static void long_sleep(int ms) | |||
| 105 | /* turn the backlight on or off */ | 105 | /* turn the backlight on or off */ |
| 106 | static void charlcd_backlight(struct charlcd *lcd, int on) | 106 | static void charlcd_backlight(struct charlcd *lcd, int on) |
| 107 | { | 107 | { |
| 108 | struct charlcd_priv *priv = to_priv(lcd); | 108 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 109 | 109 | ||
| 110 | if (!lcd->ops->backlight) | 110 | if (!lcd->ops->backlight) |
| 111 | return; | 111 | return; |
| @@ -134,7 +134,7 @@ static void charlcd_bl_off(struct work_struct *work) | |||
| 134 | /* turn the backlight on for a little while */ | 134 | /* turn the backlight on for a little while */ |
| 135 | void charlcd_poke(struct charlcd *lcd) | 135 | void charlcd_poke(struct charlcd *lcd) |
| 136 | { | 136 | { |
| 137 | struct charlcd_priv *priv = to_priv(lcd); | 137 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 138 | 138 | ||
| 139 | if (!lcd->ops->backlight) | 139 | if (!lcd->ops->backlight) |
| 140 | return; | 140 | return; |
| @@ -152,7 +152,7 @@ EXPORT_SYMBOL_GPL(charlcd_poke); | |||
| 152 | 152 | ||
| 153 | static void charlcd_gotoxy(struct charlcd *lcd) | 153 | static void charlcd_gotoxy(struct charlcd *lcd) |
| 154 | { | 154 | { |
| 155 | struct charlcd_priv *priv = to_priv(lcd); | 155 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 156 | unsigned int addr; | 156 | unsigned int addr; |
| 157 | 157 | ||
| 158 | /* | 158 | /* |
| @@ -170,7 +170,7 @@ static void charlcd_gotoxy(struct charlcd *lcd) | |||
| 170 | 170 | ||
| 171 | static void charlcd_home(struct charlcd *lcd) | 171 | static void charlcd_home(struct charlcd *lcd) |
| 172 | { | 172 | { |
| 173 | struct charlcd_priv *priv = to_priv(lcd); | 173 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 174 | 174 | ||
| 175 | priv->addr.x = 0; | 175 | priv->addr.x = 0; |
| 176 | priv->addr.y = 0; | 176 | priv->addr.y = 0; |
| @@ -179,7 +179,7 @@ static void charlcd_home(struct charlcd *lcd) | |||
| 179 | 179 | ||
| 180 | static void charlcd_print(struct charlcd *lcd, char c) | 180 | static void charlcd_print(struct charlcd *lcd, char c) |
| 181 | { | 181 | { |
| 182 | struct charlcd_priv *priv = to_priv(lcd); | 182 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 183 | 183 | ||
| 184 | if (priv->addr.x < lcd->bwidth) { | 184 | if (priv->addr.x < lcd->bwidth) { |
| 185 | if (lcd->char_conv) | 185 | if (lcd->char_conv) |
| @@ -211,7 +211,7 @@ static void charlcd_clear_fast(struct charlcd *lcd) | |||
| 211 | /* clears the display and resets X/Y */ | 211 | /* clears the display and resets X/Y */ |
| 212 | static void charlcd_clear_display(struct charlcd *lcd) | 212 | static void charlcd_clear_display(struct charlcd *lcd) |
| 213 | { | 213 | { |
| 214 | struct charlcd_priv *priv = to_priv(lcd); | 214 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 215 | 215 | ||
| 216 | lcd->ops->write_cmd(lcd, LCD_CMD_DISPLAY_CLEAR); | 216 | lcd->ops->write_cmd(lcd, LCD_CMD_DISPLAY_CLEAR); |
| 217 | priv->addr.x = 0; | 217 | priv->addr.x = 0; |
| @@ -223,7 +223,7 @@ static void charlcd_clear_display(struct charlcd *lcd) | |||
| 223 | static int charlcd_init_display(struct charlcd *lcd) | 223 | static int charlcd_init_display(struct charlcd *lcd) |
| 224 | { | 224 | { |
| 225 | void (*write_cmd_raw)(struct charlcd *lcd, int cmd); | 225 | void (*write_cmd_raw)(struct charlcd *lcd, int cmd); |
| 226 | struct charlcd_priv *priv = to_priv(lcd); | 226 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 227 | u8 init; | 227 | u8 init; |
| 228 | 228 | ||
| 229 | if (lcd->ifwidth != 4 && lcd->ifwidth != 8) | 229 | 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 | 369 | ||
| 370 | static inline int handle_lcd_special_code(struct charlcd *lcd) | 370 | static inline int handle_lcd_special_code(struct charlcd *lcd) |
| 371 | { | 371 | { |
| 372 | struct charlcd_priv *priv = to_priv(lcd); | 372 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 373 | 373 | ||
| 374 | /* LCD special codes */ | 374 | /* LCD special codes */ |
| 375 | 375 | ||
| @@ -580,7 +580,7 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) | |||
| 580 | 580 | ||
| 581 | static void charlcd_write_char(struct charlcd *lcd, char c) | 581 | static void charlcd_write_char(struct charlcd *lcd, char c) |
| 582 | { | 582 | { |
| 583 | struct charlcd_priv *priv = to_priv(lcd); | 583 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 584 | 584 | ||
| 585 | /* first, we'll test if we're in escape mode */ | 585 | /* first, we'll test if we're in escape mode */ |
| 586 | if ((c != '\n') && priv->esc_seq.len >= 0) { | 586 | 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 | 705 | ||
| 706 | static int charlcd_open(struct inode *inode, struct file *file) | 706 | static int charlcd_open(struct inode *inode, struct file *file) |
| 707 | { | 707 | { |
| 708 | struct charlcd_priv *priv = to_priv(the_charlcd); | 708 | struct charlcd_priv *priv = charlcd_to_priv(the_charlcd); |
| 709 | int ret; | 709 | int ret; |
| 710 | 710 | ||
| 711 | ret = -EBUSY; | 711 | ret = -EBUSY; |
| @@ -766,7 +766,7 @@ static void charlcd_puts(struct charlcd *lcd, const char *s) | |||
| 766 | /* initialize the LCD driver */ | 766 | /* initialize the LCD driver */ |
| 767 | static int charlcd_init(struct charlcd *lcd) | 767 | static int charlcd_init(struct charlcd *lcd) |
| 768 | { | 768 | { |
| 769 | struct charlcd_priv *priv = to_priv(lcd); | 769 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 770 | int ret; | 770 | int ret; |
| 771 | 771 | ||
| 772 | if (lcd->ops->backlight) { | 772 | if (lcd->ops->backlight) { |
| @@ -866,7 +866,7 @@ EXPORT_SYMBOL_GPL(charlcd_register); | |||
| 866 | 866 | ||
| 867 | int charlcd_unregister(struct charlcd *lcd) | 867 | int charlcd_unregister(struct charlcd *lcd) |
| 868 | { | 868 | { |
| 869 | struct charlcd_priv *priv = to_priv(lcd); | 869 | struct charlcd_priv *priv = charlcd_to_priv(lcd); |
| 870 | 870 | ||
| 871 | unregister_reboot_notifier(&panel_notifier); | 871 | unregister_reboot_notifier(&panel_notifier); |
| 872 | charlcd_puts(lcd, "\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-"); | 872 | charlcd_puts(lcd, "\x0cLCD driver unloaded.\x1b[Lc\x1b[Lb\x1b[L-"); |
