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

gpio: sta2x11: remove platform_set_drvdata() + cleanup probe

The platform_set_drvdata() call is only useful if we need to retrieve back
the private information.
Since the driver doesn't do that, it's not useful to have it.

If this is removed, we can also just do a direct return on
devm_gpiochip_add_data(). We don't need to print that this call failed as
there are other ways to log/see this during probe.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

authored by

Alexandru Ardelean and committed by
Bartosz Golaszewski
f716f1fb 52f39cfe

+1 -9
+1 -9
drivers/gpio/gpio-sta2x11.c
··· 398 398 return err; 399 399 } 400 400 401 - err = devm_gpiochip_add_data(&dev->dev, &chip->gpio, chip); 402 - if (err < 0) { 403 - dev_err(&dev->dev, "sta2x11 gpio: Can't register (%i)\n", 404 - -err); 405 - return err; 406 - } 407 - 408 - platform_set_drvdata(dev, chip); 409 - return 0; 401 + return devm_gpiochip_add_data(&dev->dev, &chip->gpio, chip); 410 402 } 411 403 412 404 static struct platform_driver sta2x11_gpio_platform_driver = {