]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
reset: amlogic: aux: drop aux registration helper
authorJerome Brunet <jbrunet@baylibre.com>
Mon, 9 Dec 2024 16:04:35 +0000 (17:04 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Wed, 15 Jan 2025 16:59:31 +0000 (17:59 +0100)
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 <arnd@arndb.de>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20241209-meson-rst-aux-rework-v1-2-d2afb69cc72e@baylibre.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/amlogic/reset-meson-aux.c
include/soc/amlogic/reset-meson-aux.h [deleted file]

index 0fc1788eb7a83810ac524facfe09b5fa032573c3..1a2024afa056ea4d9404f6444476e48265ac8da4 100644 (file)
 #include <linux/auxiliary_bus.h>
 #include <linux/regmap.h>
 #include <linux/reset-controller.h>
-#include <linux/slab.h>
 
 #include "reset-meson.h"
-#include <soc/amlogic/reset-meson-aux.h>
-
-static DEFINE_IDA(meson_rst_aux_ida);
 
 static const struct meson_reset_param meson_a1_audio_param = {
        .reset_ops      = &meson_reset_toggle_ops,
@@ -79,63 +75,6 @@ static struct auxiliary_driver meson_reset_aux_driver = {
 };
 module_auxiliary_driver(meson_reset_aux_driver);
 
-static void meson_rst_aux_release(struct device *dev)
-{
-       struct auxiliary_device *adev = to_auxiliary_dev(dev);
-
-       ida_free(&meson_rst_aux_ida, adev->id);
-       kfree(adev);
-}
-
-static void meson_rst_aux_unregister_adev(void *_adev)
-{
-       struct auxiliary_device *adev = _adev;
-
-       auxiliary_device_delete(adev);
-       auxiliary_device_uninit(adev);
-}
-
-int devm_meson_rst_aux_register(struct device *dev,
-                               const char *adev_name)
-{
-       struct auxiliary_device *adev;
-       int ret;
-
-       adev = kzalloc(sizeof(*adev), GFP_KERNEL);
-       if (!adev)
-               return -ENOMEM;
-
-       ret = ida_alloc(&meson_rst_aux_ida, GFP_KERNEL);
-       if (ret < 0)
-               goto adev_free;
-
-       adev->id = ret;
-       adev->name = adev_name;
-       adev->dev.parent = dev;
-       adev->dev.release = meson_rst_aux_release;
-       device_set_of_node_from_dev(&adev->dev, dev);
-
-       ret = auxiliary_device_init(adev);
-       if (ret)
-               goto ida_free;
-
-       ret = __auxiliary_device_add(adev, dev->driver->name);
-       if (ret) {
-               auxiliary_device_uninit(adev);
-               return ret;
-       }
-
-       return devm_add_action_or_reset(dev, meson_rst_aux_unregister_adev,
-                                       adev);
-
-ida_free:
-       ida_free(&meson_rst_aux_ida, adev->id);
-adev_free:
-       kfree(adev);
-       return ret;
-}
-EXPORT_SYMBOL_GPL(devm_meson_rst_aux_register);
-
 MODULE_DESCRIPTION("Amlogic Meson Reset Auxiliary driver");
 MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
 MODULE_LICENSE("Dual BSD/GPL");
diff --git a/include/soc/amlogic/reset-meson-aux.h b/include/soc/amlogic/reset-meson-aux.h
deleted file mode 100644 (file)
index d8a15d4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __SOC_RESET_MESON_AUX_H
-#define __SOC_RESET_MESON_AUX_H
-
-#include <linux/err.h>
-
-struct device;
-struct regmap;
-
-#if IS_ENABLED(CONFIG_RESET_MESON_AUX)
-int devm_meson_rst_aux_register(struct device *dev,
-                               struct regmap *map,
-                               const char *adev_name);
-#else
-static inline int devm_meson_rst_aux_register(struct device *dev,
-                                             struct regmap *map,
-                                             const char *adev_name)
-{
-       return 0;
-}
-#endif
-
-#endif /* __SOC_RESET_MESON_AUX_H */