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

gpio: visconti: 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
ec5aa31b 9e23bf6b

+1 -9
+1 -9
drivers/gpio/gpio-visconti.c
··· 187 187 girq->default_type = IRQ_TYPE_NONE; 188 188 girq->handler = handle_level_irq; 189 189 190 - ret = devm_gpiochip_add_data(dev, &priv->gpio_chip, priv); 191 - if (ret) { 192 - dev_err(dev, "failed to add GPIO chip\n"); 193 - return ret; 194 - } 195 - 196 - platform_set_drvdata(pdev, priv); 197 - 198 - return ret; 190 + return devm_gpiochip_add_data(dev, &priv->gpio_chip, priv); 199 191 } 200 192 201 193 static const struct of_device_id visconti_gpio_of_match[] = {