Skip to content

Commit 2064d77

Browse files
committed
Merge tag 'auxdisplay-v7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay
Pull auxdisplay fixes from Andy Shevchenko: - Fix NULL dereference in linedisp_release() - Fix ht16k33 DT bindings to avoid warnings - Handle errors in I²C transfers in lcd2s driver * tag 'auxdisplay-v7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay: auxdisplay: line-display: fix NULL dereference in linedisp_release auxdisplay: lcd2s: add error handling for i2c transfers dt-bindings: auxdisplay: ht16k33: Use unevaluatedProperties to fix common property warning
2 parents 9147566 + 7f138de commit 2064d77

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ then:
6666
required:
6767
- refresh-rate-hz
6868

69-
additionalProperties: false
69+
unevaluatedProperties: false
7070

7171
examples:
7272
- |

drivers/auxdisplay/lcd2s.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,27 @@ static int lcd2s_print(struct charlcd *lcd, int c)
9999
{
100100
struct lcd2s_data *lcd2s = lcd->drvdata;
101101
u8 buf[2] = { LCD2S_CMD_WRITE, c };
102+
int ret;
102103

103-
lcd2s_i2c_master_send(lcd2s->i2c, buf, sizeof(buf));
104+
ret = lcd2s_i2c_master_send(lcd2s->i2c, buf, sizeof(buf));
105+
if (ret < 0)
106+
return ret;
107+
if (ret != sizeof(buf))
108+
return -EIO;
104109
return 0;
105110
}
106111

107112
static int lcd2s_gotoxy(struct charlcd *lcd, unsigned int x, unsigned int y)
108113
{
109114
struct lcd2s_data *lcd2s = lcd->drvdata;
110115
u8 buf[3] = { LCD2S_CMD_CUR_POS, y + 1, x + 1 };
116+
int ret;
111117

112-
lcd2s_i2c_master_send(lcd2s->i2c, buf, sizeof(buf));
113-
118+
ret = lcd2s_i2c_master_send(lcd2s->i2c, buf, sizeof(buf));
119+
if (ret < 0)
120+
return ret;
121+
if (ret != sizeof(buf))
122+
return -EIO;
114123
return 0;
115124
}
116125

drivers/auxdisplay/line-display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ static DEFINE_IDA(linedisp_id);
365365

366366
static void linedisp_release(struct device *dev)
367367
{
368-
struct linedisp *linedisp = to_linedisp(dev);
368+
struct linedisp *linedisp = container_of(dev, struct linedisp, dev);
369369

370370
kfree(linedisp->map);
371371
kfree(linedisp->message);

0 commit comments

Comments
 (0)