Bug 116211 - ar1021_i2c has too long name
Summary: ar1021_i2c has too long name
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-12 08:59 UTC by
Modified: 2016-12-12 23:51 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.18 and up
Tree: Mainline
Regression: No


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.