hbmc-am654.c (0ea8a56de21be24cb79abb03dee79aabcd60a316) hbmc-am654.c (aca31ce96814c84d1a41aaa109c15abe61005af7)
1// SPDX-License-Identifier: GPL-2.0
2//
3// Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com/
4// Author: Vignesh Raghavendra <vigneshr@ti.com>
5
6#include <linux/err.h>
7#include <linux/kernel.h>
8#include <linux/module.h>

--- 56 unchanged lines hidden (view full) ---

65 int ret;
66
67 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
68 if (!priv)
69 return -ENOMEM;
70
71 platform_set_drvdata(pdev, priv);
72
1// SPDX-License-Identifier: GPL-2.0
2//
3// Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com/
4// Author: Vignesh Raghavendra <vigneshr@ti.com>
5
6#include <linux/err.h>
7#include <linux/kernel.h>
8#include <linux/module.h>

--- 56 unchanged lines hidden (view full) ---

65 int ret;
66
67 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
68 if (!priv)
69 return -ENOMEM;
70
71 platform_set_drvdata(pdev, priv);
72
73 ret = of_address_to_resource(np, 0, &res);
73 priv->hbdev.np = of_get_next_child(np, NULL);
74 ret = of_address_to_resource(priv->hbdev.np, 0, &res);
74 if (ret)
75 return ret;
76
77 if (of_property_read_bool(dev->of_node, "mux-controls")) {
78 struct mux_control *control = devm_mux_control_get(dev, NULL);
79
80 if (IS_ERR(control))
81 return PTR_ERR(control);

--- 16 unchanged lines hidden (view full) ---

98 priv->hbdev.map.size = resource_size(&res);
99 priv->hbdev.map.virt = devm_ioremap_resource(dev, &res);
100 if (IS_ERR(priv->hbdev.map.virt))
101 return PTR_ERR(priv->hbdev.map.virt);
102
103 priv->ctlr.dev = dev;
104 priv->ctlr.ops = &am654_hbmc_ops;
105 priv->hbdev.ctlr = &priv->ctlr;
75 if (ret)
76 return ret;
77
78 if (of_property_read_bool(dev->of_node, "mux-controls")) {
79 struct mux_control *control = devm_mux_control_get(dev, NULL);
80
81 if (IS_ERR(control))
82 return PTR_ERR(control);

--- 16 unchanged lines hidden (view full) ---

99 priv->hbdev.map.size = resource_size(&res);
100 priv->hbdev.map.virt = devm_ioremap_resource(dev, &res);
101 if (IS_ERR(priv->hbdev.map.virt))
102 return PTR_ERR(priv->hbdev.map.virt);
103
104 priv->ctlr.dev = dev;
105 priv->ctlr.ops = &am654_hbmc_ops;
106 priv->hbdev.ctlr = &priv->ctlr;
106 priv->hbdev.np = of_get_next_child(dev->of_node, NULL);
107 ret = hyperbus_register_device(&priv->hbdev);
108 if (ret) {
109 dev_err(dev, "failed to register controller\n");
110 pm_runtime_put_sync(&pdev->dev);
111 goto disable_pm;
112 }
113
114 return 0;

--- 45 unchanged lines hidden ---
107 ret = hyperbus_register_device(&priv->hbdev);
108 if (ret) {
109 dev_err(dev, "failed to register controller\n");
110 pm_runtime_put_sync(&pdev->dev);
111 goto disable_pm;
112 }
113
114 return 0;

--- 45 unchanged lines hidden ---