diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-10-23 21:54:00 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-01-25 21:05:31 +0300 |
commit | 25ded39ad064b06757d00609c36c85ab2312a94b (patch) | |
tree | 565fee13f2607137e209e05b01f1236ad7efb48e /drivers/gpu/drm/gma500 | |
parent | bfc838f8598eab49d7d3d7557e90a7a0ee9b4464 (diff) | |
download | linux-25ded39ad064b06757d00609c36c85ab2312a94b.tar.xz |
drm/gma500: Get rid of duplicate NULL checks
Since GPIOs are optional we don't need to repeat checks that are done
in the GPIO API. Remove them for good.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/gma500')
-rw-r--r-- | drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c b/drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c index 7d012db6352b..3dab94463656 100644 --- a/drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c +++ b/drivers/gpu/drm/gma500/tc35876x-dsi-lvds.c @@ -518,11 +518,9 @@ void tc35876x_toshiba_bridge_panel_off(struct drm_device *dev) dev_dbg(&tc35876x_client->dev, "%s\n", __func__); - if (bridge_bl_enable) - gpiod_set_value_cansleep(bridge_bl_enable, 0); + gpiod_set_value_cansleep(bridge_bl_enable, 0); - if (backlight_voltage) - gpiod_set_value_cansleep(backlight_voltage, 0); + gpiod_set_value_cansleep(backlight_voltage, 0); } void tc35876x_toshiba_bridge_panel_on(struct drm_device *dev) @@ -567,8 +565,7 @@ void tc35876x_toshiba_bridge_panel_on(struct drm_device *dev) "i2c write failed (%d)\n", ret); } - if (bridge_bl_enable) - gpiod_set_value_cansleep(bridge_bl_enable, 1); + gpiod_set_value_cansleep(bridge_bl_enable, 1); tc35876x_brightness_control(dev, dev_priv->brightness_adjusted); } @@ -642,20 +639,17 @@ static int tc35876x_bridge_probe(struct i2c_client *client, bridge_reset = devm_gpiod_get_optional(&client->dev, "bridge-reset", GPIOD_OUT_LOW); if (IS_ERR(bridge_reset)) return PTR_ERR(bridge_reset); - if (bridge_reset) - gpiod_set_consumer_name(bridge_reset, "tc35876x bridge reset"); + gpiod_set_consumer_name(bridge_reset, "tc35876x bridge reset"); bridge_bl_enable = devm_gpiod_get_optional(&client->dev, "bl-en", GPIOD_OUT_LOW); if (IS_ERR(bridge_bl_enable)) return PTR_ERR(bridge_bl_enable); - if (bridge_bl_enable) - gpiod_set_consumer_name(bridge_bl_enable, "tc35876x panel bl en"); + gpiod_set_consumer_name(bridge_bl_enable, "tc35876x panel bl en"); backlight_voltage = devm_gpiod_get_optional(&client->dev, "vadd", GPIOD_OUT_LOW); if (IS_ERR(backlight_voltage)) return PTR_ERR(backlight_voltage); - if (backlight_voltage) - gpiod_set_consumer_name(backlight_voltage, "tc35876x panel vadd"); + gpiod_set_consumer_name(backlight_voltage, "tc35876x panel vadd"); tc35876x_client = client; |