X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fsoc%2Fsamsung%2Fexynos-pmu.c;h=813df6e7292d7ac4cbf25d33d0e5e166dce6e14b;hb=195849ea13549dc2390b7db7d80a22d76f73dfae;hp=0acdfd82e7510189bc8bb4a254c653667d012e89;hpb=d81e72c521d46ca43c1afd2e2577d5a09279196f;p=karo-tx-linux.git diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index 0acdfd82e751..813df6e7292d 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -11,6 +11,8 @@ #include #include +#include +#include #include #include @@ -92,9 +94,18 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = { { /*sentinel*/ }, }; +struct regmap *exynos_get_pmu_regmap(void) +{ + struct device_node *np = of_find_matching_node(NULL, + exynos_pmu_of_device_ids); + if (np) + return syscon_node_to_regmap(np); + return ERR_PTR(-ENODEV); +} +EXPORT_SYMBOL_GPL(exynos_get_pmu_regmap); + static int exynos_pmu_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct device *dev = &pdev->dev; struct resource *res; @@ -106,15 +117,10 @@ static int exynos_pmu_probe(struct platform_device *pdev) pmu_context = devm_kzalloc(&pdev->dev, sizeof(struct exynos_pmu_context), GFP_KERNEL); - if (!pmu_context) { - dev_err(dev, "Cannot allocate memory.\n"); + if (!pmu_context) return -ENOMEM; - } pmu_context->dev = dev; - - match = of_match_node(exynos_pmu_of_device_ids, dev->of_node); - - pmu_context->pmu_data = match->data; + pmu_context->pmu_data = of_device_get_match_data(dev); if (pmu_context->pmu_data->pmu_init) pmu_context->pmu_data->pmu_init();