提交 2057e159 编写于 作者: G Guenter Roeck 提交者: Dmitry Torokhov

Input: cros_ec_keyb - drop unnecessary call to dev_set_drvdata and other changes

There is no call to platform_get_drvdata() or dev_get_drvdata().
Drop the unnecessary call to dev_set_drvdata().
Other relevant changes:
  Use existing variable 'dev' instead of dereferencing it several times

This conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Drop dev_set_drvdata()
- Use local variable 'struct device *dev' consistently
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 259b77ef
......@@ -242,7 +242,7 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
struct device_node *np;
int err;
np = pdev->dev.of_node;
np = dev->of_node;
if (!np)
return -ENODEV;
......@@ -272,7 +272,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
ckdev->ec = ec;
ckdev->dev = dev;
dev_set_drvdata(dev, ckdev);
idev->name = CROS_EC_DEV_NAME;
idev->phys = ec->phys_name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册