Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of/i2c: call i2c_verify_client from of_find_i2c_device_by_node

i2c_bus_type may contain both I2C clients and I2C adapters. Fix
of_find_i2c_device_by_node to call i2c_verify_client to ensure that it
only returns non-NULL of I2C clients.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>

authored by

Stephen Warren and committed by
Wolfram Sang
d9afca37 e1fac69f

+1 -1
+1 -1
drivers/of/of_i2c.c
··· 90 90 if (!dev) 91 91 return NULL; 92 92 93 - return to_i2c_client(dev); 93 + return i2c_verify_client(dev); 94 94 } 95 95 EXPORT_SYMBOL(of_find_i2c_device_by_node); 96 96