Skip to contentSkip to conversation

Input: elants_i2c - zero-extend hardware ID in firmware name

PATCH In review Dmitry Torokhov 3 participants 3 messages Apr 18, 2015 – Apr 20, 2015

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: elants_i2c - zero-extend hardware ID in firmware name

Let's zero-extend hardware id number when forming firmware file name,
to avoid kernel requesting firmware like "elants_i2c_ 0.bin", which
is quite unexpected.

---
 drivers/input/touchscreen/elants_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/elants_i2c.c +1 -1
index 43b3c9c..0efd766 100644
@@ -699,7 +699,7 @@ static int elants_i2c_fw_update(struct elants_data *ts)
 	char *fw_name;
 	int error;
 
-	fw_name = kasprintf(GFP_KERNEL, "elants_i2c_%4x.bin", ts->hw_version);
+	fw_name = kasprintf(GFP_KERNEL, "elants_i2c_%04x.bin", ts->hw_version);
 	if (!fw_name)
 		return -ENOMEM;
 
Signature · 5 lines
2.2.0.rc0.207.ga3a616c


-- 
Dmitry
Acked-by on v1 1/1
#1 lore raw
Quoted 26 lines · Dmitry Torokhov

Let's zero-extend hardware id number when forming firmware file name,
to avoid kernel requesting firmware like "elants_i2c_ 0.bin", which
is quite unexpected.

---
 drivers/input/touchscreen/elants_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/elants_i2c.c +1 -2
index 43b3c9c..0efd766 100644
@@ -699,7 +699,7 @@ static int elants_i2c_fw_update(struct elants_data *ts)
        char *fw_name;
        int error;
 
-       fw_name = kasprintf(GFP_KERNEL, "elants_i2c_%4x.bin", ts->hw_version);
+       fw_name = kasprintf(GFP_KERNEL, "elants_i2c_%04x.bin", ts->hw_version);
        if (!fw_name)
                return -ENOMEM;
 
--

2.2.0.rc0.207.ga3a616c

Quoted 2 lines

--
Dmitry

Looks good to me.