Browse Source

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>
Guenter Roeck 8 years ago
parent
commit
8ace98df9a
1 changed files with 3 additions and 5 deletions
  1. 3 5
      drivers/input/misc/tps65218-pwrbutton.c

+ 3 - 5
drivers/input/misc/tps65218-pwrbutton.c

@@ -95,7 +95,7 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
 	int error;
 	int error;
 	int irq;
 	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)
 	if (!match)
 		return -ENXIO;
 		return -ENXIO;
 
 
@@ -118,10 +118,9 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
 
 
 	input_set_capability(idev, EV_KEY, KEY_POWER);
 	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->dev = dev;
 	pwr->idev = idev;
 	pwr->idev = idev;
-	platform_set_drvdata(pdev, pwr);
 	device_init_wakeup(dev, true);
 	device_init_wakeup(dev, true);
 
 
 	irq = platform_get_irq(pdev, 0);
 	irq = platform_get_irq(pdev, 0);
@@ -136,8 +135,7 @@ static int tps6521x_pb_probe(struct platform_device *pdev)
 						IRQF_ONESHOT,
 						IRQF_ONESHOT,
 					  pwr->data->name, pwr);
 					  pwr->data->name, pwr);
 	if (error) {
 	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;
 		return error;
 	}
 	}