Bug 116211

Summary: ar1021_i2c has too long name
Product: Drivers Reporter: ⎓ (m.frohiky)
Component: Input DevicesAssignee: drivers_input-devices
Status: NEW ---    
Severity: normal CC: dmitry.torokhov, jdelvare, wsa
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.18 and up Subsystem:
Regression: No Bisected commit-id:

Description 2016-04-12 08:59:21 UTC
ar1021_i2c is registered as an I2C device with name="MICROCHIP_AR1021_I2C" which is too long.
Because of that kernel reports invalid modalias "i2c:MICROCHIP_AR1021_I2" ("C" is missing) and the module doesn't get loaded.
Also, interesting thing is that the module itself has the full modalias (as reported by modinfo).
Comment 1 Dmitry Torokhov 2016-12-12 23:47:34 UTC
Jean, Wolfram, do we expect client->name to be NULL terminated? I.e right now the driver uses exactly 20 symbols (I2C_NAME_SIZE) when filling out i2c_device_id structure. Should we shorten the name or have i2c core allocate I2C_NAME_SIZE + 1 for name fields if it wants NULL-termination?
Comment 2 Dmitry Torokhov 2016-12-12 23:51:37 UTC
Ah, it looks it is only by chance file2alias.c outputs full name as it also expects it to be NULL-terminated and 0 driver data in the ID instance serves as that terminator. I'll shorten the name in the driver.