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

gpio: bd9571mwv: 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
21dde316 aa93b0f3

+1 -10
+1 -10
drivers/gpio/gpio-bd9571mwv.c
··· 97 97 static int bd9571mwv_gpio_probe(struct platform_device *pdev) 98 98 { 99 99 struct bd9571mwv_gpio *gpio; 100 - int ret; 101 100 102 101 gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); 103 102 if (!gpio) 104 103 return -ENOMEM; 105 104 106 - platform_set_drvdata(pdev, gpio); 107 - 108 105 gpio->regmap = dev_get_regmap(pdev->dev.parent, NULL); 109 106 gpio->chip = template_chip; 110 107 gpio->chip.parent = pdev->dev.parent; 111 108 112 - ret = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); 113 - if (ret < 0) { 114 - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); 115 - return ret; 116 - } 117 - 118 - return 0; 109 + return devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); 119 110 } 120 111 121 112 static const struct platform_device_id bd9571mwv_gpio_id_table[] = {