提交 afeb7b45 编写于 作者: V Varka Bhadram 提交者: Linus Walleij

gpio: use (!foo) instead of (foo == NULL)

Signed-off-by: NVarka Bhadram <varkab@cdac.in>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 4878b466
...@@ -367,7 +367,7 @@ static int adp5588_gpio_probe(struct i2c_client *client, ...@@ -367,7 +367,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
struct gpio_chip *gc; struct gpio_chip *gc;
int ret, i, revid; int ret, i, revid;
if (pdata == NULL) { if (!pdata) {
dev_err(&client->dev, "missing platform data\n"); dev_err(&client->dev, "missing platform data\n");
return -ENODEV; return -ENODEV;
} }
...@@ -379,7 +379,7 @@ static int adp5588_gpio_probe(struct i2c_client *client, ...@@ -379,7 +379,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
} }
dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL); dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL);
if (dev == NULL) if (!dev)
return -ENOMEM; return -ENOMEM;
dev->client = client; dev->client = client;
......
...@@ -103,7 +103,7 @@ static int arizona_gpio_probe(struct platform_device *pdev) ...@@ -103,7 +103,7 @@ static int arizona_gpio_probe(struct platform_device *pdev)
arizona_gpio = devm_kzalloc(&pdev->dev, sizeof(*arizona_gpio), arizona_gpio = devm_kzalloc(&pdev->dev, sizeof(*arizona_gpio),
GFP_KERNEL); GFP_KERNEL);
if (arizona_gpio == NULL) if (!arizona_gpio)
return -ENOMEM; return -ENOMEM;
arizona_gpio->arizona = arizona; arizona_gpio->arizona = arizona;
......
...@@ -212,7 +212,7 @@ static int da9052_gpio_probe(struct platform_device *pdev) ...@@ -212,7 +212,7 @@ static int da9052_gpio_probe(struct platform_device *pdev)
int ret; int ret;
gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
if (gpio == NULL) if (!gpio)
return -ENOMEM; return -ENOMEM;
gpio->da9052 = dev_get_drvdata(pdev->dev.parent); gpio->da9052 = dev_get_drvdata(pdev->dev.parent);
......
...@@ -146,7 +146,7 @@ static int da9055_gpio_probe(struct platform_device *pdev) ...@@ -146,7 +146,7 @@ static int da9055_gpio_probe(struct platform_device *pdev)
int ret; int ret;
gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
if (gpio == NULL) if (!gpio)
return -ENOMEM; return -ENOMEM;
gpio->da9055 = dev_get_drvdata(pdev->dev.parent); gpio->da9055 = dev_get_drvdata(pdev->dev.parent);
......
...@@ -156,7 +156,7 @@ static int kempld_gpio_probe(struct platform_device *pdev) ...@@ -156,7 +156,7 @@ static int kempld_gpio_probe(struct platform_device *pdev)
} }
gpio = devm_kzalloc(dev, sizeof(*gpio), GFP_KERNEL); gpio = devm_kzalloc(dev, sizeof(*gpio), GFP_KERNEL);
if (gpio == NULL) if (!gpio)
return -ENOMEM; return -ENOMEM;
gpio->pld = pld; gpio->pld = pld;
......
...@@ -151,7 +151,7 @@ static int mc33880_remove(struct spi_device *spi) ...@@ -151,7 +151,7 @@ static int mc33880_remove(struct spi_device *spi)
struct mc33880 *mc; struct mc33880 *mc;
mc = spi_get_drvdata(spi); mc = spi_get_drvdata(spi);
if (mc == NULL) if (!mc)
return -ENODEV; return -ENODEV;
gpiochip_remove(&mc->chip); gpiochip_remove(&mc->chip);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册