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

gpio: crystalcove: 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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

authored by

Alexandru Ardelean and committed by
Andy Shevchenko
5b2d3326 6efb943b

+1 -9
+1 -9
drivers/gpio/gpio-crystalcove.c
··· 339 339 if (!cg) 340 340 return -ENOMEM; 341 341 342 - platform_set_drvdata(pdev, cg); 343 - 344 342 mutex_init(&cg->buslock); 345 343 cg->chip.label = KBUILD_MODNAME; 346 344 cg->chip.direction_input = crystalcove_gpio_dir_in; ··· 370 372 return retval; 371 373 } 372 374 373 - retval = devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg); 374 - if (retval) { 375 - dev_warn(&pdev->dev, "add gpio chip error: %d\n", retval); 376 - return retval; 377 - } 378 - 379 - return 0; 375 + return devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg); 380 376 } 381 377 382 378 static struct platform_driver crystalcove_gpio_driver = {