@@ -169,6 +169,12 @@ static void __init imx6q_1588_init(void)
struct regmap *gpr;
u32 clksel;
+ gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
+ if (IS_ERR(gpr)) {
+ pr_err("failed to find fsl,imx6q-iomuxc-gpr regmap\n");
+ return;
+ }
+
np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-fec");
if (!np) {
pr_warn("%s: failed to find fec node\n", __func__);
@@ -195,13 +201,8 @@ static void __init imx6q_1588_init(void)
clksel = clk_is_match(ptp_clk, enet_ref) ?
IMX6Q_GPR1_ENET_CLK_SEL_ANATOP :
IMX6Q_GPR1_ENET_CLK_SEL_PAD;
- gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
- if (!IS_ERR(gpr))
- regmap_update_bits(gpr, IOMUXC_GPR1,
- IMX6Q_GPR1_ENET_CLK_SEL_MASK,
- clksel);
- else
- pr_err("failed to find fsl,imx6q-iomuxc-gpr regmap\n");
+ regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_ENET_CLK_SEL_MASK,
+ clksel);
clk_put(enet_ref);
put_ptp_clk: