mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
input: sensors: lsensor: ls_ap321xx supports modularity
Fixes: c8ebec26c7 ("input: sensor: sensor supports modularity")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: If35571893de2efd484b00bbcf940915a201dfa65
This commit is contained in:
@@ -377,27 +377,15 @@ struct sensor_operate light_ap321xx_ops = {
|
||||
|
||||
/****************operate according to sensor chip:end************/
|
||||
|
||||
//function name should not be changed
|
||||
static struct sensor_operate *light_get_ops(void)
|
||||
{
|
||||
return &light_ap321xx_ops;
|
||||
}
|
||||
|
||||
static int light_ap321xx_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *devid)
|
||||
{
|
||||
struct sensor_operate *ops = light_get_ops();
|
||||
int type = ops->type;
|
||||
|
||||
return sensor_register_device(type, client, NULL, devid, light_get_ops);
|
||||
return sensor_register_device(client, NULL, devid, &light_ap321xx_ops);
|
||||
}
|
||||
|
||||
static int light_ap321xx_remove(struct i2c_client *client)
|
||||
{
|
||||
struct sensor_operate *ops = light_get_ops();
|
||||
int type = ops->type;
|
||||
|
||||
return sensor_unregister_device(type, client, NULL, light_get_ops);
|
||||
return sensor_unregister_device(client, NULL, &light_ap321xx_ops);
|
||||
}
|
||||
|
||||
static const struct i2c_device_id light_ap321xx_id[] = {
|
||||
|
||||
Reference in New Issue
Block a user