October 2017
Intermediate to advanced
586 pages
14h 8m
English
The prototype of the remove function looks as follows:
static int foo_remove(struct i2c_client *client)
The remove() function also provides the same struct i2c_client* as the probe() function, so you can retrieve your private data. For example, you may need to process some cleaning or any other stuff, based on the private data you set up in the probe function:
static int mc9s08dz60_remove(struct i2c_client *client)
{
struct mc9s08dz60 *mc9s;
/* We retrieve our private data */
mc9s = i2c_get_clientdata(client);
/* Which hold gpiochip we want to work on */
return gpiochip_remove(&mc9s->chip);
}
The remove function has the responsibility to unregister us from the subsystem where we registered in the probe() function. ...