Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Guenter Roeck and committed by
Dmitry Torokhov
8ace98df aa45590a

+3 -5
+3 -5
drivers/input/misc/tps65218-pwrbutton.c
··· 95 95 int error; 96 96 int irq; 97 97 98 - match = of_match_node(of_tps6521x_pb_match, pdev->dev.of_node); 98 + match = of_match_node(of_tps6521x_pb_match, dev->of_node); 99 99 if (!match) 100 100 return -ENXIO; 101 101 ··· 118 118 119 119 input_set_capability(idev, EV_KEY, KEY_POWER); 120 120 121 - pwr->regmap = dev_get_regmap(pdev->dev.parent, NULL); 121 + pwr->regmap = dev_get_regmap(dev->parent, NULL); 122 122 pwr->dev = dev; 123 123 pwr->idev = idev; 124 - platform_set_drvdata(pdev, pwr); 125 124 device_init_wakeup(dev, true); 126 125 127 126 irq = platform_get_irq(pdev, 0); ··· 135 136 IRQF_ONESHOT, 136 137 pwr->data->name, pwr); 137 138 if (error) { 138 - dev_err(dev, "failed to request IRQ #%d: %d\n", 139 - irq, error); 139 + dev_err(dev, "failed to request IRQ #%d: %d\n", irq, error); 140 140 return error; 141 141 } 142 142