Пример #1
0
/* registered in driver struct */
static int cyttsp_i2c_remove(struct i2c_client *client)
{
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP3_DEVICETREE_SUPPORT
	struct device *dev = &client->dev;
	const struct of_device_id *match;
#endif
	struct cyttsp_i2c *ts;
	int retval = 0;

	ts = i2c_get_clientdata(client);
	if (ts == NULL) {
		pr_err("%s: client pointer error\n", __func__);
		retval = -EINVAL;
	} else {
		cyttsp_core_release(ts->ttsp_client);
		
#ifdef CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP3_DEVICETREE_SUPPORT
		match = of_match_device(of_match_ptr(cyttsp3_i2c_of_match), dev);
		if (match)
			cyttsp3_devtree_clean_pdata(dev);
#endif
		kfree(ts);
	}
	return retval;
}
Пример #2
0
/* registered in driver struct */
static int __devexit cyttsp_i2c_remove(struct i2c_client *client)
{
	struct cyttsp_i2c *ts = cyttsp_get_bus_priv(&client->dev);

	dev_dbg(&client->dev, "cyttsp_i2c_remove\n");

	cyttsp_core_release(dev_get_drvdata(&client->dev));
	kfree(ts);
	return 0;
}