提交 ec208612 编写于 作者: D Dmitry Torokhov

Input: migor-ts - use proper client data accessor functions

Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 468792eb
...@@ -143,8 +143,6 @@ static int migor_ts_probe(struct i2c_client *client, ...@@ -143,8 +143,6 @@ static int migor_ts_probe(struct i2c_client *client,
goto err0; goto err0;
} }
dev_set_drvdata(&client->dev, priv);
input = input_allocate_device(); input = input_allocate_device();
if (!input) { if (!input) {
dev_err(&client->dev, "Failed to allocate input device.\n"); dev_err(&client->dev, "Failed to allocate input device.\n");
...@@ -183,6 +181,7 @@ static int migor_ts_probe(struct i2c_client *client, ...@@ -183,6 +181,7 @@ static int migor_ts_probe(struct i2c_client *client,
goto err2; goto err2;
} }
i2c_set_clientdata(client, priv);
device_init_wakeup(&client->dev, 1); device_init_wakeup(&client->dev, 1);
return 0; return 0;
...@@ -199,7 +198,7 @@ static int migor_ts_probe(struct i2c_client *client, ...@@ -199,7 +198,7 @@ static int migor_ts_probe(struct i2c_client *client,
static int migor_ts_remove(struct i2c_client *client) static int migor_ts_remove(struct i2c_client *client)
{ {
struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); struct migor_ts_priv *priv = i2c_get_clientdata(client);
free_irq(priv->irq, priv); free_irq(priv->irq, priv);
input_unregister_device(priv->input); input_unregister_device(priv->input);
...@@ -213,7 +212,7 @@ static int migor_ts_remove(struct i2c_client *client) ...@@ -213,7 +212,7 @@ static int migor_ts_remove(struct i2c_client *client)
static int migor_ts_suspend(struct device *dev) static int migor_ts_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); struct migor_ts_priv *priv = i2c_get_clientdata(client);
if (device_may_wakeup(&client->dev)) if (device_may_wakeup(&client->dev))
enable_irq_wake(priv->irq); enable_irq_wake(priv->irq);
...@@ -224,7 +223,7 @@ static int migor_ts_suspend(struct device *dev) ...@@ -224,7 +223,7 @@ static int migor_ts_suspend(struct device *dev)
static int migor_ts_resume(struct device *dev) static int migor_ts_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct migor_ts_priv *priv = dev_get_drvdata(&client->dev); struct migor_ts_priv *priv = i2c_get_clientdata(client);
if (device_may_wakeup(&client->dev)) if (device_may_wakeup(&client->dev))
disable_irq_wake(priv->irq); disable_irq_wake(priv->irq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册