aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/tps65218-pwrbutton.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2017-01-18 11:42:44 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-01-18 11:49:17 -0800
commit8ace98df9ade746de229dd75c144a25ec9fe2613 (patch)
treee912a937f956af3c9e545ea7ea6b23cfb15f24ab /drivers/input/misc/tps65218-pwrbutton.c
parentInput: soc_button_array - use 'dev' instead of dereferencing it (diff)
downloadlinux-dev-8ace98df9ade746de229dd75c144a25ec9fe2613.tar.xz
linux-dev-8ace98df9ade746de229dd75c144a25ec9fe2613.zip
Input: tps65218-pwrbutton - drop unnecessary call to platform_set_drvdata
There is no call to platform_get_drvdata() or dev_get_drvdata(). Drop the unnecessary call to platform_set_drvdata(). Also use existing variable 'dev' instead of dereferencing it several times. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/input/misc/tps65218-pwrbutton.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c
index 3273217ce80c..65384754714d 100644
--- a/drivers/input/misc/tps65218-pwrbutton.c
+++ b/drivers/input/misc/tps65218-pwrbutton.c
@@ -95,7 +95,7 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
int error;
int irq;
- match = of_match_node(of_tps6521x_pb_match, pdev->dev.of_node);
+ match = of_match_node(of_tps6521x_pb_match, dev->of_node);
if (!match)
return -ENXIO;
@@ -118,10 +118,9 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
input_set_capability(idev, EV_KEY, KEY_POWER);
- pwr->regmap = dev_get_regmap(pdev->dev.parent, NULL);
+ pwr->regmap = dev_get_regmap(dev->parent, NULL);
pwr->dev = dev;
pwr->idev = idev;
- platform_set_drvdata(pdev, pwr);
device_init_wakeup(dev, true);
irq = platform_get_irq(pdev, 0);
@@ -136,8 +135,7 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
IRQF_ONESHOT,
pwr->data->name, pwr);
if (error) {
- dev_err(dev, "failed to request IRQ #%d: %d\n",
- irq, error);
+ dev_err(dev, "failed to request IRQ #%d: %d\n", irq, error);
return error;
}