插入代码测试

阅读更多
static int i2c_device_probe(struct device *dev)

{

        struct i2c_client       *client = i2c_verify_client(dev);

        struct i2c_driver       *driver;

        int status;

        if (!client)

                 return 0;

         driver = to_i2c_driver(dev->driver);

         if (!driver->probe || !driver->id_table)

                 return -ENODEV;

         client->driver = driver;

        if (!device_can_wakeup(&client->dev))

               device_init_wakeup(&client->dev,

                                         client->flags & I2C_CLIENT_WAKE);

        dev_dbg(dev, "probe/n");

         status = driver->probe(client, i2c_match_id(driver->id_table, client));

         if (status) {

                 client->driver = NULL;

                 i2c_set_clientdata(client, NULL);

         }

         return status;

}

你可能感兴趣的:(插入代码测试)