static int __devexit cyttsp4_spi_remove(struct spi_device *spi)
{
	struct device *dev = &spi->dev;
	struct cyttsp4_spi *ts_spi = dev_get_drvdata(dev);

	dev_info(dev, "%s\n", __func__);
	cyttsp4_del_adapter(ts_spi->id);
	pm_runtime_disable(&spi->dev);
	dev_set_drvdata(&spi->dev, NULL);
	kfree(ts_spi);
	return 0;
}
Ejemplo n.º 2
0
static int __devexit cyttsp4_spi_remove(struct spi_device *spi)
{
    struct device *dev = &spi->dev;
    struct cyttsp4_spi *ts_spi = dev_get_drvdata(dev);
    char const *adap_id = dev_get_platdata(dev);
    char const *id;

    if (adap_id)
        id = adap_id;
    else
        id = CYTTSP4_SPI_NAME;

    dev_info(dev, "%s\n", __func__);
    cyttsp4_del_adapter(id);
    pm_runtime_disable(&spi->dev);
    dev_set_drvdata(&spi->dev, NULL);
    kfree(ts_spi);
    return 0;
}
/* registered in driver struct */
static int __devexit cyttsp4_i2c_remove(struct i2c_client *client)
{
	struct device *dev = &client->dev;
	struct cyttsp4_i2c *ts_i2c = dev_get_drvdata(dev);
	char const *adap_id = dev_get_platdata(dev);
	char const *id;

	if (adap_id)
		id = adap_id;
	else
		id = CYTTSP4_I2C_NAME;

	dev_info(dev, "%s\n", __func__);
	cyttsp4_del_adapter(id);
	pm_runtime_disable(&client->dev);
	dev_set_drvdata(&client->dev, NULL);
	i2c_set_clientdata(client, NULL);
	kfree(ts_i2c);
	return 0;
}