50d6b9d56e
The absence of decrementation of linedisp_id is incorrect in two ways, i.e. it may cause: - an ID exhaustion - (and if the above is addressed) a duplicate id number may be allocated next time a device is added Replace above mentioned approach by using IDA framework. Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
46 lines
1.3 KiB
C
46 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Character line display core support
|
|
*
|
|
* Copyright (C) 2016 Imagination Technologies
|
|
* Author: Paul Burton <paul.burton@mips.com>
|
|
*
|
|
* Copyright (C) 2021 Glider bv
|
|
*/
|
|
|
|
#ifndef _LINEDISP_H
|
|
#define _LINEDISP_H
|
|
|
|
/**
|
|
* struct linedisp - character line display private data structure
|
|
* @dev: the line display device
|
|
* @timer: timer used to implement scrolling
|
|
* @update: function called to update the display
|
|
* @buf: pointer to the buffer for the string currently displayed
|
|
* @message: the full message to display or scroll on the display
|
|
* @num_chars: the number of characters that can be displayed
|
|
* @message_len: the length of the @message string
|
|
* @scroll_pos: index of the first character of @message currently displayed
|
|
* @scroll_rate: scroll interval in jiffies
|
|
* @id: instance id of this display
|
|
*/
|
|
struct linedisp {
|
|
struct device dev;
|
|
struct timer_list timer;
|
|
void (*update)(struct linedisp *linedisp);
|
|
char *buf;
|
|
char *message;
|
|
unsigned int num_chars;
|
|
unsigned int message_len;
|
|
unsigned int scroll_pos;
|
|
unsigned int scroll_rate;
|
|
unsigned int id;
|
|
};
|
|
|
|
int linedisp_register(struct linedisp *linedisp, struct device *parent,
|
|
unsigned int num_chars, char *buf,
|
|
void (*update)(struct linedisp *linedisp));
|
|
void linedisp_unregister(struct linedisp *linedisp);
|
|
|
|
#endif /* LINEDISP_H */
|