The source project of this merge request has been removed.
Fail probe on device mismatch
Draft because returning -EINVAL or -ENODEV if the device is not attached gives a scary stack trace. I'm not sure what this is about, there's no procedure called s5k3l6xx_i2c_driver_init
that I could find.
The driver can be loaded without trouble later.
[ 22.923984] Call trace:
[ 22.923990] _regulator_put.part.22+0x15c/0x168
[ 22.923998] regulator_put+0x40/0x58
[ 22.924006] devm_regulator_release+0x1c/0x28
[ 22.924013] release_nodes+0x1b8/0x230
[ 22.924023] devres_release_all+0x40/0x60
[ 22.924029] really_probe+0x1f8/0x4d8
[ 22.924039] driver_probe_device+0xfc/0x168
[ 22.924047] device_driver_attach+0x7c/0x88
[ 22.924054] __driver_attach+0xac/0x178
[ 22.924062] bus_for_each_dev+0x7c/0xd0
[ 22.924069] driver_attach+0x2c/0x38
[ 22.924076] bus_add_driver+0x1a8/0x240
[ 22.924083] driver_register+0x6c/0x128
[ 22.924091] i2c_register_driver+0x50/0xb0
[ 22.924103] s5k3l6xx_i2c_driver_init+0x28/0x1000 [s5k3l6xx]
[ 22.924123] do_one_initcall+0x54/0x2c0
[ 22.924132] do_init_module+0x60/0x248
[ 22.924140] load_module+0x2064/0x2388
[ 22.924146] __do_sys_finit_module+0xc0/0x128
[ 22.924152] __arm64_sys_finit_module+0x28/0x38
[ 22.924159] el0_svc_common.constprop.2+0x94/0x130
[ 22.924169] do_el0_svc+0x24/0x30
[ 22.924176] el0_svc+0x24/0x38
[ 22.924187] el0_sync_handler+0x90/0xb8
[ 22.924193] el0_sync+0x154/0x180
[ 22.924200] ---[ end trace e82647ba6f69c41f ]---
[ 22.924439] s5k3l6xx: probe of 3-002d failed with error -22
Edited by Dorota Czaplejewicz