int ret;
        unsigned int gpio = icl->gpio;
 
-       if (gpio != NO_GPIO) {
+       if (gpio_is_valid(gpio)) {
                /* We have a data bus switch. */
                ret = gpio_request(gpio, "mt9m001");
                if (ret < 0) {
 
        mt9m001->switch_gpio = gpio;
 #else
-       mt9m001->switch_gpio = NO_GPIO;
+       mt9m001->switch_gpio = -EINVAL;
 #endif
        return 0;
 }
 static void bus_switch_release(struct mt9m001 *mt9m001)
 {
 #ifdef CONFIG_MT9M001_PCA9536_SWITCH
-       if (mt9m001->switch_gpio != NO_GPIO)
+       if (gpio_is_valid(mt9m001->switch_gpio))
                gpio_free(mt9m001->switch_gpio);
 #endif
 }
 static int bus_switch_act(struct mt9m001 *mt9m001, int go8bit)
 {
 #ifdef CONFIG_MT9M001_PCA9536_SWITCH
-       if (mt9m001->switch_gpio == NO_GPIO)
+       if (!gpio_is_valid(mt9m001->switch_gpio))
                return -ENODEV;
 
        gpio_set_value_cansleep(mt9m001->switch_gpio, go8bit);
            (mt9m001->datawidth != 9  && (width_flag == IS_DATAWIDTH_9)) ||
            (mt9m001->datawidth != 8  && (width_flag == IS_DATAWIDTH_8))) {
                /* data width switch requested */
-               if (mt9m001->switch_gpio == NO_GPIO)
+               if (!gpio_is_valid(mt9m001->switch_gpio))
                        return -EINVAL;
 
                /* Well, we actually only can do 10 or 8 bits... */
 
        int ret;
        unsigned int gpio = icl->gpio;
 
-       if (gpio != NO_GPIO) {
+       if (gpio_is_valid(gpio)) {
                /* We have a data bus switch. */
                ret = gpio_request(gpio, "mt9v022");
                if (ret < 0) {
 
        mt9v022->switch_gpio = gpio;
 #else
-       mt9v022->switch_gpio = NO_GPIO;
+       mt9v022->switch_gpio = -EINVAL;
 #endif
        return 0;
 }
 static void bus_switch_release(struct mt9v022 *mt9v022)
 {
 #ifdef CONFIG_MT9V022_PCA9536_SWITCH
-       if (mt9v022->switch_gpio != NO_GPIO)
+       if (gpio_is_valid(mt9v022->switch_gpio))
                gpio_free(mt9v022->switch_gpio);
 #endif
 }
 static int bus_switch_act(struct mt9v022 *mt9v022, int go8bit)
 {
 #ifdef CONFIG_MT9V022_PCA9536_SWITCH
-       if (mt9v022->switch_gpio == NO_GPIO)
+       if (!gpio_is_valid(mt9v022->switch_gpio))
                return -ENODEV;
 
        gpio_set_value_cansleep(mt9v022->switch_gpio, go8bit);
            (mt9v022->datawidth != 9  && (width_flag == IS_DATAWIDTH_9)) ||
            (mt9v022->datawidth != 8  && (width_flag == IS_DATAWIDTH_8))) {
                /* data width switch requested */
-               if (mt9v022->switch_gpio == NO_GPIO)
+               if (!gpio_is_valid(mt9v022->switch_gpio))
                        return -EINVAL;
 
                /* Well, we actually only can do 10 or 8 bits... */