Skip to content

Commit 72bb827

Browse files
jbrun3tpH5
authored andcommitted
reset: amlogic: aux: drop aux registration helper
Having the aux registration helper along with the registered driver is not great dependency wise. It does not allow the registering driver to be properly decoupled from the registered auxiliary driver. Drop the registration helper from the amlogic auxiliary reset driver. This will be handled in the registering clock driver to start with while a more generic solution is worked on. Suggested-by: Arnd Bergmann <[email protected]> Signed-off-by: Jerome Brunet <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Zabel <[email protected]>
1 parent ccfba09 commit 72bb827

File tree

2 files changed

+0
-84
lines changed

2 files changed

+0
-84
lines changed

drivers/reset/amlogic/reset-meson-aux.c

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@
1111
#include <linux/auxiliary_bus.h>
1212
#include <linux/regmap.h>
1313
#include <linux/reset-controller.h>
14-
#include <linux/slab.h>
1514

1615
#include "reset-meson.h"
17-
#include <soc/amlogic/reset-meson-aux.h>
18-
19-
static DEFINE_IDA(meson_rst_aux_ida);
2016

2117
static const struct meson_reset_param meson_a1_audio_param = {
2218
.reset_ops = &meson_reset_toggle_ops,
@@ -79,63 +75,6 @@ static struct auxiliary_driver meson_reset_aux_driver = {
7975
};
8076
module_auxiliary_driver(meson_reset_aux_driver);
8177

82-
static void meson_rst_aux_release(struct device *dev)
83-
{
84-
struct auxiliary_device *adev = to_auxiliary_dev(dev);
85-
86-
ida_free(&meson_rst_aux_ida, adev->id);
87-
kfree(adev);
88-
}
89-
90-
static void meson_rst_aux_unregister_adev(void *_adev)
91-
{
92-
struct auxiliary_device *adev = _adev;
93-
94-
auxiliary_device_delete(adev);
95-
auxiliary_device_uninit(adev);
96-
}
97-
98-
int devm_meson_rst_aux_register(struct device *dev,
99-
const char *adev_name)
100-
{
101-
struct auxiliary_device *adev;
102-
int ret;
103-
104-
adev = kzalloc(sizeof(*adev), GFP_KERNEL);
105-
if (!adev)
106-
return -ENOMEM;
107-
108-
ret = ida_alloc(&meson_rst_aux_ida, GFP_KERNEL);
109-
if (ret < 0)
110-
goto adev_free;
111-
112-
adev->id = ret;
113-
adev->name = adev_name;
114-
adev->dev.parent = dev;
115-
adev->dev.release = meson_rst_aux_release;
116-
device_set_of_node_from_dev(&adev->dev, dev);
117-
118-
ret = auxiliary_device_init(adev);
119-
if (ret)
120-
goto ida_free;
121-
122-
ret = __auxiliary_device_add(adev, dev->driver->name);
123-
if (ret) {
124-
auxiliary_device_uninit(adev);
125-
return ret;
126-
}
127-
128-
return devm_add_action_or_reset(dev, meson_rst_aux_unregister_adev,
129-
adev);
130-
131-
ida_free:
132-
ida_free(&meson_rst_aux_ida, adev->id);
133-
adev_free:
134-
kfree(adev);
135-
return ret;
136-
}
137-
EXPORT_SYMBOL_GPL(devm_meson_rst_aux_register);
138-
13978
MODULE_DESCRIPTION("Amlogic Meson Reset Auxiliary driver");
14079
MODULE_AUTHOR("Jerome Brunet <[email protected]>");
14180
MODULE_LICENSE("Dual BSD/GPL");

include/soc/amlogic/reset-meson-aux.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)