Commit 30c5b080 authored by Mathis MARION's avatar Mathis MARION Committed by Federico Vaga

Kernel 5.2 compatibility for i2c_new_device

`i2c_new_device` disappeared in kernel 5.2 and onwards.
It is now required to use `i2c_new_client_device`, which
works the same way except for error checking.
Signed-off-by: 's avatarMathis MARION <mathis.marion@grenoble-inp.org>
parent 96630ec6
......@@ -982,7 +982,11 @@ static int ocores_i2c_probe(struct platform_device *pdev)
/* add in known devices to the bus */
if (pdata) {
for (i = 0; i < pdata->num_devices; i++)
#if KERNEL_VERSION(5, 2, 0) <= LINUX_VERSION_CODE
i2c_new_client_device(&i2c->adap, pdata->devices + i);
#else
i2c_new_device(&i2c->adap, pdata->devices + i);
#endif
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment