struct gpio_device *gdev;
        unsigned int desc_index;
        int base = 0;
-       int ret = 0;
+       int ret;
 
        /* Only allow one set() and one set_multiple(). */
        if ((gc->set && gc->set_rv) ||
 
        device_set_node(&gdev->dev, gpiochip_choose_fwnode(gc));
 
-       gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL);
-       if (gdev->id < 0) {
-               ret = gdev->id;
+       ret = ida_alloc(&gpio_ida, GFP_KERNEL);
+       if (ret < 0)
                goto err_free_gdev;
-       }
+       gdev->id = ret;
 
        ret = dev_set_name(&gdev->dev, GPIOCHIP_NAME "%d", gdev->id);
        if (ret)
  */
 int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags)
 {
-       int ret = 0;
+       int ret;
 
        VALIDATE_DESC(desc);
 
  */
 int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags)
 {
-       int ret = 0;
+       int ret;
 
        VALIDATE_DESC(desc);