/* When traversing the driver model tree, perhaps using driver model iterators like @device_for_each_child(), you can't assume very much about the nodes you find. Use this function to avoid oopses caused by wrongly treating some non-I2C device as an i2c_client.  */
struct i2c_client* i2c_verify_client(struct device *dev)
/* When traversing the driver model tree, perhaps using driver model iterators like @device_for_each_child(), you can't assume very much about the nodes you find. Use this function to avoid oopses caused by wrongly treating some non-I2C device as an i2c_client.  */
struct i2c_client* i2c_verify_client(struct device *dev)
{
	return (dev->type == &i2c_client_type)
			? to_i2c_client(dev)
			: NULL;
}