powerpc/hvsi: Fix endianness issues in the HVSI driver
[firefly-linux-kernel-4.4.55.git] / drivers / tty / serial / serial_mctrl_gpio.c
index d7b846d416309a00401d396d1a6e5f7870fca975..402f7fb541333a67a0383a4ac2fb3754ed2f395d 100644 (file)
@@ -49,8 +49,7 @@ void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl)
        unsigned int count = 0;
 
        for (i = 0; i < UART_GPIO_MAX; i++)
-               if (!IS_ERR_OR_NULL(gpios->gpio[i]) &&
-                   mctrl_gpios_desc[i].dir_out) {
+               if (gpios->gpio[i] && mctrl_gpios_desc[i].dir_out) {
                        desc_array[count] = gpios->gpio[i];
                        value_array[count] = !!(mctrl & mctrl_gpios_desc[i].mctrl);
                        count++;
@@ -118,7 +117,7 @@ void mctrl_gpio_free(struct device *dev, struct mctrl_gpios *gpios)
        enum mctrl_gpio_idx i;
 
        for (i = 0; i < UART_GPIO_MAX; i++)
-               if (!IS_ERR_OR_NULL(gpios->gpio[i]))
+               if (gpios->gpio[i])
                        devm_gpiod_put(dev, gpios->gpio[i]);
        devm_kfree(dev, gpios);
 }