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

gpio: tps65910: 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
96a03e86 f716f1fb

+2 -10
+2 -10
drivers/gpio/gpio-tps65910.c
··· 165 165 } 166 166 167 167 skip_init: 168 - ret = devm_gpiochip_add_data(&pdev->dev, &tps65910_gpio->gpio_chip, 169 - tps65910_gpio); 170 - if (ret < 0) { 171 - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); 172 - return ret; 173 - } 174 - 175 - platform_set_drvdata(pdev, tps65910_gpio); 176 - 177 - return ret; 168 + return devm_gpiochip_add_data(&pdev->dev, &tps65910_gpio->gpio_chip, 169 + tps65910_gpio); 178 170 } 179 171 180 172 static struct platform_driver tps65910_gpio_driver = {