Skip to content

Commit 78934d8

Browse files
digetxlinusw
authored andcommitted
gpio: max77620: Don't set of_node
The gpiochip_add_data() takes care of setting the of_node to the parent's device of_node, hence there is no need to do it manually in the driver's code. This patch corrects the parent's device pointer and removes the unnecessary setting of the of_node. Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Laxman Dewangan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 2a5e6f7 commit 78934d8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/gpio/gpio-max77620.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static int max77620_gpio_probe(struct platform_device *pdev)
279279
mgpio->dev = &pdev->dev;
280280

281281
mgpio->gpio_chip.label = pdev->name;
282-
mgpio->gpio_chip.parent = &pdev->dev;
282+
mgpio->gpio_chip.parent = pdev->dev.parent;
283283
mgpio->gpio_chip.direction_input = max77620_gpio_dir_input;
284284
mgpio->gpio_chip.get = max77620_gpio_get;
285285
mgpio->gpio_chip.direction_output = max77620_gpio_dir_output;
@@ -288,9 +288,6 @@ static int max77620_gpio_probe(struct platform_device *pdev)
288288
mgpio->gpio_chip.ngpio = MAX77620_GPIO_NR;
289289
mgpio->gpio_chip.can_sleep = 1;
290290
mgpio->gpio_chip.base = -1;
291-
#ifdef CONFIG_OF_GPIO
292-
mgpio->gpio_chip.of_node = pdev->dev.parent->of_node;
293-
#endif
294291

295292
platform_set_drvdata(pdev, mgpio);
296293

0 commit comments

Comments
 (0)