gpio: msc313: remove unnecessary call to platform_set_drvdata()
Subsystems (2)
PATCH 1/1 gpio: msc313: remove unnecessary call to platform_set_drvdata()
This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.
--- drivers/gpio/gpio-msc313.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpio/gpio-msc313.c +0 -2
@@ -643,8 +643,6 @@ static int msc313_gpio_probe(struct platform_device *pdev)if (IS_ERR (gpio->base))return PTR_ERR (gpio->base); -platform_set_drvdata (pdev, gpio); - gpiochip =devm_kzalloc (dev,sizeof (*gpiochip),GFP_KERNEL );if (!gpiochip)return -ENOMEM ;
Signature · 1 line
2.34.1
Quoted 4 lines · Andrei Coardos
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata()call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Andrei Coardos
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata()call to access the private data of the driver.
Not true.
Quoted 4 lines
Quoted 2 lines
Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.
Reviewed-by Andy Shevchenko <[email protected]>
I have to withdraw this, the patch is wrong.
NAK.
Sorry for the confusion (I have looked for the wrong pattern).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Romain Perier
maintainerHi,
The private data is "struct msc313_gpio *gpio". This private data is "binded" to the gpio_chip via devm_gpiochip_add_data, right ? Then it is retrieved via gpiochip_get_data(chip), right ?
Romain
Quoted 23 lines · Andy Shevchenko
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Andrei Coardos
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata()call to access the private data of the driver.Not true.
Quoted 4 lines
Quoted 2 lines
Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.
Reviewed-by Andy Shevchenko <[email protected]>I have to withdraw this, the patch is wrong.
NAK.Sorry for the confusion (I have looked for the wrong pattern).
--
With Best Regards,
Andy Shevchenko
On Thu, Jul 27, 2023 at 09:00:36AM +0200, Romain Perier wrote:
First of all, please do not top-post!
Quoted 2 lines
The private data is "struct
msc313_gpio*gpio". This private data is "binded" to thegpio_chipviadevm_gpiochip_add_data, right ?
No.
Quoted 1 line
Then it is retrieved via
gpiochip_get_data(chip), right ?
No.
The driver data is used in PM callbacks. See below.
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Andy Shevchenko
Quoted 3 lines · Andrei Coardos
Quoted 2 lines
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata()call to access the private data of the driver.Not true.
^^^^
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.
Reviewed-by Andy Shevchenko <[email protected]>I have to withdraw this, the patch is wrong.
NAK.Sorry for the confusion (I have looked for the wrong pattern).
Signature · 2 lines
With Best Regards, Andy Shevchenko