Merge 5.14-rc5 into tty-next
[linux-2.6-microblaze.git] / drivers / tty / serial / max310x.c
index ef11860..3df0788 100644 (file)
@@ -1271,18 +1271,13 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty
        /* Always ask for fixed clock rate from a property. */
        device_property_read_u32(dev, "clock-frequency", &uartclk);
 
-       s->clk = devm_clk_get_optional(dev, "osc");
+       xtal = device_property_match_string(dev, "clock-names", "osc") < 0;
+       if (xtal)
+               s->clk = devm_clk_get_optional(dev, "xtal");
+       else
+               s->clk = devm_clk_get_optional(dev, "osc");
        if (IS_ERR(s->clk))
                return PTR_ERR(s->clk);
-       if (s->clk) {
-               xtal = false;
-       } else {
-               s->clk = devm_clk_get_optional(dev, "xtal");
-               if (IS_ERR(s->clk))
-                       return PTR_ERR(s->clk);
-
-               xtal = true;
-       }
 
        ret = clk_prepare_enable(s->clk);
        if (ret)