media: i2c: otp_eeprom: fix the warning when multi sensor use

resolve the warning log below:
[    2.920218][    T1] ------------[ cut here ]------------
[    2.920681][    T1] proc_dir_entry '/proc/otp_eeprom' already
registered
[    2.921284][    T1] WARNING: CPU: 6 PID: 1 at fs/proc/generic.c:382
proc_register+0x12c/0x1b0
[    2.922024][    T1] Modules linked in:
[    2.922357][    T1] CPU: 6 PID: 1 Comm: swapper/0 Not tainted 5.10.66
[    2.922964][    T1] Hardware name: Rockchip RK3588S EVB1 LP4X V10
Board (DT)
[    2.923584][    T1] pstate: 60800009 (nZCv daif -PAN +UAO -TCO
BTYPE=--)
[    2.924171][    T1] pc : proc_register+0x12c/0x1b0
[    2.924590][    T1] lr : proc_register+0x124/0x1b0
[    2.925008][    T1] sp : ffffffc01242ba00
[    2.925359][    T1] x29: ffffffc01242ba00 x28: 0000000000000000
[    2.925890][    T1] x27: 0000000000000000 x26: 0000000000000000
[    2.926422][    T1] x25: ffffff81035b7748 x24: ffffff81036e82d8
[    2.926953][    T1] x23: 000000000000000a x22: ffffff81035b782c
[    2.927484][    T1] x21: ffffffc0121442e0 x20: ffffffc012144260
[    2.928015][    T1] x19: ffffff81035b7780 x18: ffffffc0124250a0
[    2.928545][    T1] x17: 0000000000000000 x16: 00000000000000d8
[    2.929076][    T1] x15: 0000000000000004 x14: 0000000000003fff
[    2.929607][    T1] x13: ffffffc011fac968 x12: 0000000000000003
[    2.930138][    T1] x11: 00000000ffffbfff x10: 00000000ffffffff
[    2.930669][    T1] x9 : a8dc5ce6d1a47200 x8 : a8dc5ce6d1a47200
[    2.931201][    T1] x7 : 392e32202020205b x6 : ffffffc01237edb8
[    2.931732][    T1] x5 : ffffffffffffffff x4 : 0000000000000000
[    2.932263][    T1] x3 : ffffffc011c3e801 x2 : 0000000000000000
[    2.932793][    T1] x1 : 0000000000000001 x0 : ffffffc0123a1e08

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: If5e7adcfce605fb1aeae542bb434f8058f84ef12
This commit is contained in:
Wang Panzhenzhuan
2022-03-01 02:28:01 +00:00
committed by Tao Huang
parent 2b570aa157
commit 0467aec3b6

View File

@@ -944,7 +944,8 @@ static int eeprom_probe(struct i2c_client *client,
v4l2_i2c_subdev_init(&eeprom_dev->sd,
client, &eeprom_ops);
eeprom_dev->client = client;
sprintf(eeprom_dev->name, "%s", DEVICE_NAME);
snprintf(eeprom_dev->name, sizeof(eeprom_dev->name), "%s-%d-%02x",
DEVICE_NAME, i2c_adapter_id(client->adapter), client->addr);
eeprom_proc_init(eeprom_dev);
pm_runtime_set_active(&client->dev);
pm_runtime_enable(&client->dev);