Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static int mc9s08dz60_probe ( struct i2c_client *  client,
const struct i2c_device_id *  id 
) [static]

mc9s08dz60 I2C attach function

Parameters:
adapter struct i2c_adapter *
Returns:
0

Definition at line 127 of file mc9s08dz60.c.

{
      int ret = 0;
      struct mc9s08dz60 *mc9s08dz60 = NULL;
      struct mc9s08dz60_platform_data *plat_data = client->dev.platform_data;
      pr_info("mc9s08dz60 probing .... \n");

      mc9s08dz60 = kzalloc(sizeof(struct mc9s08dz60), GFP_KERNEL);
      if (mc9s08dz60 == NULL)
            return -ENOMEM;

      i2c_set_clientdata(client, mc9s08dz60);
      mc9s08dz60->dev = &client->dev;
      mc9s08dz60->i2c_client = client;

      if (plat_data && plat_data->init) {
            ret = plat_data->init(mc9s08dz60);
            if (ret != 0)
                  return -1;
      }

      ret = device_create_file(&client->dev, &mc9s08dz60_dev_attr);
      if (ret)
            dev_err(&client->dev, "create device file failed!\n");


      mc9s08dz60_i2c_client = client;

      return 0;
}


Generated by  Doxygen 1.6.0   Back to index