Skip to content

Commit c41b7e2

Browse files
Fengguang WuDinh Nguyen
authored andcommitted
FogBugz #229601: newhaven lcd: fix kbuild test robot warnings
The kbuild test robot noticed some problems with the newhaven lcd driver. 1. lcd_of_match is not NULL terminated at line 606 2. Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element 3. Random config test warnings: drivers/built-in.o: In function `brightness_store': >> newhaven_lcd.c:(.text+0xd2225): undefined reference to `i2c_master_send' drivers/built-in.o: In function `lcd_init': >> newhaven_lcd.c:(.init.text+0x8a9e): undefined reference to `i2c_register_driver' drivers/built-in.o: In function `lcd_exit': >> newhaven_lcd.c:(.exit.text+0x439): undefined reference to `i2c_del_driver' drivers/built-in.o: In function `lcd_remove': >> newhaven_lcd.c:(.exit.text+0x462): undefined reference to `i2c_master_send' This patch squashes the two patches they kindly sent us plus adds a Kconfig fix for the warnings in #3 above. Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Alan Tull <[email protected]>
1 parent c6179d4 commit c41b7e2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/tty/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ config BFIN_JTAG_COMM_CONSOLE
177177

178178
config NEWHAVEN_LCD
179179
tristate "NEWHAVEN LCD"
180+
depends on I2C
180181
help
181182
Add support for a TTY device on a Newhaven I2C LCD device.
182183

drivers/tty/newhaven_lcd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static int lcd_load_custom_fonts(struct lcd *lcd_data)
142142
u8 buf[LCD_BYTES_PER_FONT_CMD];
143143
int count, i;
144144

145-
for (i = 0; i < sizeof(custom_fonts) / sizeof(struct custom_font) ; i++) {
145+
for (i = 0; i < ARRAY_SIZE(custom_fonts); i++) {
146146
buf[0] = LCD_COMMAND;
147147
buf[1] = LCD_CUSTOM_CHAR;
148148
buf[2] = custom_fonts[i].mapping;
@@ -604,6 +604,7 @@ static int __exit lcd_remove(struct i2c_client *client)
604604

605605
static const struct of_device_id lcd_of_match[] = {
606606
{ .compatible = "newhaven,nhd-0216k3z-nsw-bbw", },
607+
{},
607608
};
608609

609610
static const struct i2c_device_id lcd_id[] = {

0 commit comments

Comments
 (0)