hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/mux/mmio.c
....@@ -28,6 +28,7 @@
2828
2929 static const struct of_device_id mux_mmio_dt_ids[] = {
3030 { .compatible = "mmio-mux", },
31
+ { .compatible = "reg-mux", },
3132 { /* sentinel */ }
3233 };
3334 MODULE_DEVICE_TABLE(of, mux_mmio_dt_ids);
....@@ -43,7 +44,10 @@
4344 int ret;
4445 int i;
4546
46
- regmap = syscon_node_to_regmap(np->parent);
47
+ if (of_device_is_compatible(np, "mmio-mux"))
48
+ regmap = syscon_node_to_regmap(np->parent);
49
+ else
50
+ regmap = dev_get_regmap(dev->parent, NULL) ?: ERR_PTR(-ENODEV);
4751 if (IS_ERR(regmap)) {
4852 ret = PTR_ERR(regmap);
4953 dev_err(dev, "failed to get regmap: %d\n", ret);