mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 23:00:21 +00:00
gpio: wm8994: 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>
This commit is contained in:
parent
14ebdaec6d
commit
e076aeda46
@ -263,7 +263,6 @@ static int wm8994_gpio_probe(struct platform_device *pdev)
|
||||
struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent);
|
||||
struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev);
|
||||
struct wm8994_gpio *wm8994_gpio;
|
||||
int ret;
|
||||
|
||||
wm8994_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm8994_gpio),
|
||||
GFP_KERNEL);
|
||||
@ -279,17 +278,7 @@ static int wm8994_gpio_probe(struct platform_device *pdev)
|
||||
else
|
||||
wm8994_gpio->gpio_chip.base = -1;
|
||||
|
||||
ret = devm_gpiochip_add_data(&pdev->dev, &wm8994_gpio->gpio_chip,
|
||||
wm8994_gpio);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, wm8994_gpio);
|
||||
|
||||
return ret;
|
||||
return devm_gpiochip_add_data(&pdev->dev, &wm8994_gpio->gpio_chip, wm8994_gpio);
|
||||
}
|
||||
|
||||
static struct platform_driver wm8994_gpio_driver = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user