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

gpio: tps68470: 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
91d594b2 21dde316

+1 -11
+1 -11
drivers/gpio/gpio-tps68470.c
··· 125 125 static int tps68470_gpio_probe(struct platform_device *pdev) 126 126 { 127 127 struct tps68470_gpio_data *tps68470_gpio; 128 - int ret; 129 128 130 129 tps68470_gpio = devm_kzalloc(&pdev->dev, sizeof(*tps68470_gpio), 131 130 GFP_KERNEL); ··· 145 146 tps68470_gpio->gc.base = -1; 146 147 tps68470_gpio->gc.parent = &pdev->dev; 147 148 148 - ret = devm_gpiochip_add_data(&pdev->dev, &tps68470_gpio->gc, 149 - tps68470_gpio); 150 - if (ret < 0) { 151 - dev_err(&pdev->dev, "Failed to register gpio_chip: %d\n", ret); 152 - return ret; 153 - } 154 - 155 - platform_set_drvdata(pdev, tps68470_gpio); 156 - 157 - return ret; 149 + return devm_gpiochip_add_data(&pdev->dev, &tps68470_gpio->gc, tps68470_gpio); 158 150 } 159 151 160 152 static struct platform_driver tps68470_gpio_driver = {