[PATCH] gpio : max77620: remove unneeded platform_set_drvdata() call

Andrei Coardos posted 1 patch 2 years, 6 months ago
drivers/gpio/gpio-max77620.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] gpio : max77620: remove unneeded platform_set_drvdata() call
Posted by Andrei Coardos 2 years, 6 months ago
This function call is not required because no counterpart
platform_get_drvdata() call is present to leverage the private data of
the driver.
Since the private data is confined to this driver file, external access
is not feasible.
The use of this function appears redundant in the current context of the
driver's implementation.

Reviewed-by: Alexandru Ardelean <alex@shruggie.ro>
Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
---
 drivers/gpio/gpio-max77620.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index c18b60e39a94..8c2a5609161f 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -331,8 +331,6 @@ static int max77620_gpio_probe(struct platform_device *pdev)
 	girq->init_hw = max77620_gpio_irq_init_hw;
 	girq->threaded = true;
 
-	platform_set_drvdata(pdev, mgpio);
-
 	ret = devm_gpiochip_add_data(&pdev->dev, &mgpio->gpio_chip, mgpio);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "gpio_init: Failed to add max77620_gpio\n");
-- 
2.34.1
Re: [PATCH] gpio : max77620: remove unneeded platform_set_drvdata() call
Posted by Andy Shevchenko 2 years, 6 months ago
On Thu, Jul 20, 2023 at 4:26 PM Andrei Coardos <aboutphysycs@gmail.com> wrote:
>
> This function call is not required because no counterpart
> platform_get_drvdata() call is present to leverage the private data of
> the driver.
> Since the private data is confined to this driver file, external access
> is not feasible.
> The use of this function appears redundant in the current context of the
> driver's implementation.

Use full room of the lines, no need to start each sentence at a new line.

Also, fix the Subject.
It should be prefixed with "gpio: DRIVER: ", where DRIVER is one in
question. This applies to all your last patches.

-- 
With Best Regards,
Andy Shevchenko