summaryrefslogtreecommitdiff
path: root/drivers/auxdisplay/line-display.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-02-12 19:01:36 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-02-15 13:31:12 +0200
commit50d6b9d56e69563d3b261ee25bc644c59c5bff58 (patch)
tree9bf0f919315adb02c61dca792cebc7c6582a6b03 /drivers/auxdisplay/line-display.h
parent2327960f0c5ecd7a285e69284b6ec3fdbd2757be (diff)
downloadlinux-50d6b9d56e69563d3b261ee25bc644c59c5bff58.tar.gz
linux-50d6b9d56e69563d3b261ee25bc644c59c5bff58.tar.bz2
linux-50d6b9d56e69563d3b261ee25bc644c59c5bff58.zip
auxdisplay: linedisp: Use unique number for id
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>
Diffstat (limited to 'drivers/auxdisplay/line-display.h')
-rw-r--r--drivers/auxdisplay/line-display.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/auxdisplay/line-display.h b/drivers/auxdisplay/line-display.h
index 0f5891d34c48..5068e3445e4f 100644
--- a/drivers/auxdisplay/line-display.h
+++ b/drivers/auxdisplay/line-display.h
@@ -22,6 +22,7 @@
* @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;
@@ -33,6 +34,7 @@ struct linedisp {
unsigned int message_len;
unsigned int scroll_pos;
unsigned int scroll_rate;
+ unsigned int id;
};
int linedisp_register(struct linedisp *linedisp, struct device *parent,