int value_array[UART_GPIO_MAX];
        unsigned int count = 0;
 
-       if (IS_ERR_OR_NULL(gpios))
-               return;
-
        for (i = 0; i < UART_GPIO_MAX; i++)
                if (!IS_ERR_OR_NULL(gpios->gpio[i]) &&
                    mctrl_gpios_desc[i].dir_out) {
 struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios,
                                      enum mctrl_gpio_idx gidx)
 {
-       if (!IS_ERR_OR_NULL(gpios) && !IS_ERR_OR_NULL(gpios->gpio[gidx]))
-               return gpios->gpio[gidx];
-       else
-               return NULL;
+       return gpios->gpio[gidx];
 }
 EXPORT_SYMBOL_GPL(mctrl_gpio_to_gpiod);
 
 {
        enum mctrl_gpio_idx i;
 
-       /*
-        * return it unchanged if the structure is not allocated
-        */
-       if (IS_ERR_OR_NULL(gpios))
-               return *mctrl;
-
        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) {
                        if (gpiod_get_value(gpios->gpio[i]))
                                *mctrl |= mctrl_gpios_desc[i].mctrl;
                        else
 {
        enum mctrl_gpio_idx i;
 
-       if (IS_ERR_OR_NULL(gpios))
-               return;
-
        for (i = 0; i < UART_GPIO_MAX; i++)
                if (!IS_ERR_OR_NULL(gpios->gpio[i]))
                        devm_gpiod_put(dev, gpios->gpio[i]);