Commit 52728565 authored by Enrico Weigelt, metux IT consult's avatar Enrico Weigelt, metux IT consult Committed by Linus Walleij

gpio: janz-ttl: Drop unneccessary temp variable dev

don't need the temporary variable "dev", directly use &pdev->dev
Signed-off-by: default avatarEnrico Weigelt, metux IT consult <info@metux.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 01d078aa
...@@ -144,18 +144,17 @@ static void ttl_setup_device(struct ttl_module *mod) ...@@ -144,18 +144,17 @@ static void ttl_setup_device(struct ttl_module *mod)
static int ttl_probe(struct platform_device *pdev) static int ttl_probe(struct platform_device *pdev)
{ {
struct janz_platform_data *pdata; struct janz_platform_data *pdata;
struct device *dev = &pdev->dev;
struct ttl_module *mod; struct ttl_module *mod;
struct gpio_chip *gpio; struct gpio_chip *gpio;
int ret; int ret;
pdata = dev_get_platdata(&pdev->dev); pdata = dev_get_platdata(&pdev->dev);
if (!pdata) { if (!pdata) {
dev_err(dev, "no platform data\n"); dev_err(&pdev->dev, "no platform data\n");
return -ENXIO; return -ENXIO;
} }
mod = devm_kzalloc(dev, sizeof(*mod), GFP_KERNEL); mod = devm_kzalloc(&pdev->dev, sizeof(*mod), GFP_KERNEL);
if (!mod) if (!mod)
return -ENOMEM; return -ENOMEM;
...@@ -181,9 +180,9 @@ static int ttl_probe(struct platform_device *pdev) ...@@ -181,9 +180,9 @@ static int ttl_probe(struct platform_device *pdev)
gpio->base = -1; gpio->base = -1;
gpio->ngpio = 20; gpio->ngpio = 20;
ret = devm_gpiochip_add_data(dev, gpio, NULL); ret = devm_gpiochip_add_data(&pdev->dev, gpio, NULL);
if (ret) { if (ret) {
dev_err(dev, "unable to add GPIO chip\n"); dev_err(&pdev->dev, "unable to add GPIO chip\n");
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment