struct clk *clk;
        unsigned int irq_parent;
        bool has_both_edge_trigger;
+       bool needs_clk;
 };
 
 #define IOINTSEL 0x00  /* General IO/Interrupt Switching Register */
 
 struct gpio_rcar_info {
        bool has_both_edge_trigger;
+       bool needs_clk;
 };
 
 static const struct gpio_rcar_info gpio_rcar_info_gen1 = {
        .has_both_edge_trigger = false,
+       .needs_clk = false,
 };
 
 static const struct gpio_rcar_info gpio_rcar_info_gen2 = {
        .has_both_edge_trigger = true,
+       .needs_clk = true,
 };
 
 static const struct of_device_id gpio_rcar_of_table[] = {
        ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0, &args);
        *npins = ret == 0 ? args.args[2] : RCAR_MAX_GPIO_PER_BANK;
        p->has_both_edge_trigger = info->has_both_edge_trigger;
+       p->needs_clk = info->needs_clk;
 
        if (*npins == 0 || *npins > RCAR_MAX_GPIO_PER_BANK) {
                dev_warn(&p->pdev->dev,
 
        p->clk = devm_clk_get(dev, NULL);
        if (IS_ERR(p->clk)) {
-               dev_warn(dev, "unable to get clock\n");
+               if (p->needs_clk) {
+                       dev_err(dev, "unable to get clock\n");
+                       ret = PTR_ERR(p->clk);
+                       goto err0;
+               }
                p->clk = NULL;
        }