linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper
@ 2025-02-18 19:29 Jerome Brunet
  2025-02-18 19:29 ` [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers Jerome Brunet
                   ` (7 more replies)
  0 siblings, 8 replies; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

The suggestion for this change was initially discussed here: [1]

This patchset adds and use a helper to create a simple auxiliary device.
The goal is to remove boilerplate code that tends to get repeated for
simple cases.

Only the last change was tested on actual HW. The other usage of the helper
have only been compile tested with x64_64 allmodconfig. There are many other
simple cases of auxiliary device creation but those tend to use the
'container_of' trick to allocate the auxiliary device. It is possible to
convert these drivers to use the provided helper but the conversion is
slightly more complex.

NOTE: This series is based on -rc1. Only the first change is meant to
applied. The reset will likely wait for the helper to land in mainline.
Rebase on the corresponding subsystem will be done when/if necessary.

[1]: https://lore.kernel.org/linux-clk/df0a53ee859e450d84e81547099f5f36.sboyd@kernel.org

Changes in v4:
- Added eyeq reset patch from Theo (Thanks)
- Changed returned value to 'valid or NULL'. Consumers should return
  -ENODEV if translation to int is necessary.
- Export the non-managed function helpers
- Default id to 0 for the simpler devm_auxiliary_device_create() as
  suggested by Conor
- Fix clk-imx8mp-audiomix config problem reported by Ira
- Rebased on drm-next for ti-sn65dsi86
- Link to v3: https://lore.kernel.org/r/20250211-aux-device-create-helper-v3-0-7edb50524909@baylibre.com

Changes in v3:
- Implement Ira's suggestion to use KBUILD_MODNAME by default, same as
  auxiliary_driver_register()
- Link to v2: https://lore.kernel.org/r/20250206-aux-device-create-helper-v2-0-fa6a0f326527@baylibre.com

Changes in v2:
- Add usage examples, as requested.
- Add 'id' as function parameter:  Adding the example usage showed that
  handling IDA allocation was not appropriate and making the usage more
  complex for simple use case.
- Also add 'modname' as parameter: Most driver have been using
  KBUILD_MODNAME and this actually rarely align with the driver name.
- Link to v1: https://lore.kernel.org/r/20241210-aux-device-create-helper-v1-1-5887f4d89308@baylibre.com

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
Jerome Brunet (7):
      driver core: auxiliary bus: add device creation helpers
      reset: mpfs: use the auxiliary device creation
      drm/bridge: ti-sn65dsi86: use the auxiliary device
      platform: arm64: lenovo-yoga-c630: use the auxiliary device creation helper
      clk: eyeq: use the auxiliary device creation helper
      clk: clk-imx8mp-audiomix: use the auxiliary device creation helper
      clk: amlogic: axg-audio: use the auxiliary reset driver - take 2

Théo Lebrun (1):
      reset: eyeq: drop device_set_of_node_from_dev() done by parent

 drivers/base/auxiliary.c                  | 108 ++++++++++++++++++++++++++++
 drivers/clk/clk-eyeq.c                    |  57 ++++-----------
 drivers/clk/imx/clk-imx8mp-audiomix.c     |  49 +++----------
 drivers/clk/meson/Kconfig                 |   2 +-
 drivers/clk/meson/axg-audio.c             | 114 ++++--------------------------
 drivers/gpu/drm/bridge/ti-sn65dsi86.c     |  49 ++-----------
 drivers/platform/arm64/lenovo-yoga-c630.c |  40 +----------
 drivers/reset/reset-eyeq.c                |  13 +---
 drivers/reset/reset-mpfs.c                |  56 ++-------------
 include/linux/auxiliary_bus.h             |  17 +++++
 10 files changed, 176 insertions(+), 329 deletions(-)
---
base-commit: 0ed1356af8f629ae807963b7db4e501e3b580bc2
change-id: 20241210-aux-device-create-helper-93141524e523

Best regards,
-- 
Jerome


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
@ 2025-02-18 19:29 ` Jerome Brunet
  2025-02-19  9:06   ` Dmitry Baryshkov
                     ` (2 more replies)
  2025-02-18 19:29 ` [PATCH v4 2/8] reset: mpfs: use the auxiliary device creation Jerome Brunet
                   ` (6 subsequent siblings)
  7 siblings, 3 replies; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

Add helper functions to create a device on the auxiliary bus.

This is meant for fairly simple usage of the auxiliary bus, to avoid having
the same code repeated in the different drivers.

Suggested-by: Stephen Boyd <sboyd@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/base/auxiliary.c      | 108 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/auxiliary_bus.h |  17 +++++++
 2 files changed, 125 insertions(+)

diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
index afa4df4c5a3f371b91d8dd8c4325495d32ad1291..a6d46c2759be81a0739f07528d5959c2a76eb8a8 100644
--- a/drivers/base/auxiliary.c
+++ b/drivers/base/auxiliary.c
@@ -385,6 +385,114 @@ void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv)
 }
 EXPORT_SYMBOL_GPL(auxiliary_driver_unregister);
 
+static void auxiliary_device_release(struct device *dev)
+{
+	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
+
+	kfree(auxdev);
+}
+
+/**
+ * auxiliary_device_create - create a device on the auxiliary bus
+ * @dev: parent device
+ * @modname: module name used to create the auxiliary driver name.
+ * @devname: auxiliary bus device name
+ * @platform_data: auxiliary bus device platform data
+ * @id: auxiliary bus device id
+ *
+ * Helper to create an auxiliary bus device.
+ * The device created matches driver 'modname.devname' on the auxiliary bus.
+ */
+struct auxiliary_device *auxiliary_device_create(struct device *dev,
+						 const char *modname,
+						 const char *devname,
+						 void *platform_data,
+						 int id)
+{
+	struct auxiliary_device *auxdev;
+	int ret;
+
+	auxdev = kzalloc(sizeof(*auxdev), GFP_KERNEL);
+	if (!auxdev)
+		return NULL;
+
+	auxdev->id = id;
+	auxdev->name = devname;
+	auxdev->dev.parent = dev;
+	auxdev->dev.platform_data = platform_data;
+	auxdev->dev.release = auxiliary_device_release;
+	device_set_of_node_from_dev(&auxdev->dev, dev);
+
+	ret = auxiliary_device_init(auxdev);
+	if (ret) {
+		kfree(auxdev);
+		return NULL;
+	}
+
+	ret = __auxiliary_device_add(auxdev, modname);
+	if (ret) {
+		/*
+		 * It may look odd but auxdev should not be freed here.
+		 * auxiliary_device_uninit() calls device_put() which call
+		 * the device release function, freeing auxdev.
+		 */
+		auxiliary_device_uninit(auxdev);
+		return NULL;
+	}
+
+	return auxdev;
+}
+EXPORT_SYMBOL_GPL(auxiliary_device_create);
+
+/**
+ * auxiliary_device_destroy - remove an auxiliary device
+ * @auxdev: pointer to the auxdev to be removed
+ *
+ * Helper to remove an auxiliary device created with
+ * auxiliary_device_create()
+ */
+void auxiliary_device_destroy(void *auxdev)
+{
+	struct auxiliary_device *_auxdev = auxdev;
+
+	auxiliary_device_delete(_auxdev);
+	auxiliary_device_uninit(_auxdev);
+}
+EXPORT_SYMBOL_GPL(auxiliary_device_destroy);
+
+/**
+ * __devm_auxiliary_device_create - create a managed device on the auxiliary bus
+ * @dev: parent device
+ * @modname: module name used to create the auxiliary driver name.
+ * @devname: auxiliary bus device name
+ * @platform_data: auxiliary bus device platform data
+ * @id: auxiliary bus device id
+ *
+ * Device managed helper to create an auxiliary bus device.
+ * The device created matches driver 'modname.devname' on the auxiliary bus.
+ */
+struct auxiliary_device *__devm_auxiliary_device_create(struct device *dev,
+							const char *modname,
+							const char *devname,
+							void *platform_data,
+							int id)
+{
+	struct auxiliary_device *auxdev;
+	int ret;
+
+	auxdev = auxiliary_device_create(dev, modname, devname, platform_data, id);
+	if (IS_ERR(auxdev))
+		return auxdev;
+
+	ret = devm_add_action_or_reset(dev, auxiliary_device_destroy,
+				       auxdev);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return auxdev;
+}
+EXPORT_SYMBOL_GPL(__devm_auxiliary_device_create);
+
 void __init auxiliary_bus_init(void)
 {
 	WARN_ON(bus_register(&auxiliary_bus_type));
diff --git a/include/linux/auxiliary_bus.h b/include/linux/auxiliary_bus.h
index 65dd7f15437474468acf0e28f6932a7ff2cfff2c..4086afd0cc6b96084c190f24acc304cde5d1749a 100644
--- a/include/linux/auxiliary_bus.h
+++ b/include/linux/auxiliary_bus.h
@@ -254,6 +254,23 @@ int __auxiliary_driver_register(struct auxiliary_driver *auxdrv, struct module *
 
 void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv);
 
+struct auxiliary_device *auxiliary_device_create(struct device *dev,
+						 const char *modname,
+						 const char *devname,
+						 void *platform_data,
+						 int id);
+void auxiliary_device_destroy(void *auxdev);
+
+struct auxiliary_device *__devm_auxiliary_device_create(struct device *dev,
+							const char *modname,
+							const char *devname,
+							void *platform_data,
+							int id);
+
+#define devm_auxiliary_device_create(dev, devname, platform_data)     \
+	__devm_auxiliary_device_create(dev, KBUILD_MODNAME, devname,  \
+				       platform_data, 0)
+
 /**
  * module_auxiliary_driver() - Helper macro for registering an auxiliary driver
  * @__auxiliary_driver: auxiliary driver struct

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v4 2/8] reset: mpfs: use the auxiliary device creation
  2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
  2025-02-18 19:29 ` [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers Jerome Brunet
@ 2025-02-18 19:29 ` Jerome Brunet
  2025-02-19  9:16   ` Philipp Zabel
  2025-02-18 19:29 ` [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device Jerome Brunet
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

The auxiliary device creation of this driver is simple enough to
use the available auxiliary device creation helper.

Use it and remove some boilerplate code.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/reset/reset-mpfs.c | 56 +++++-----------------------------------------
 1 file changed, 5 insertions(+), 51 deletions(-)

diff --git a/drivers/reset/reset-mpfs.c b/drivers/reset/reset-mpfs.c
index 574e59db83a4fcf30b60cb5f638607a2ec7b0580..f6fa10e03ea889e5434110156f7bece808a6ae92 100644
--- a/drivers/reset/reset-mpfs.c
+++ b/drivers/reset/reset-mpfs.c
@@ -155,62 +155,16 @@ static int mpfs_reset_probe(struct auxiliary_device *adev,
 	return devm_reset_controller_register(dev, rcdev);
 }
 
-static void mpfs_reset_unregister_adev(void *_adev)
-{
-	struct auxiliary_device *adev = _adev;
-
-	auxiliary_device_delete(adev);
-	auxiliary_device_uninit(adev);
-}
-
-static void mpfs_reset_adev_release(struct device *dev)
-{
-	struct auxiliary_device *adev = to_auxiliary_dev(dev);
-
-	kfree(adev);
-}
-
-static struct auxiliary_device *mpfs_reset_adev_alloc(struct device *clk_dev)
-{
-	struct auxiliary_device *adev;
-	int ret;
-
-	adev = kzalloc(sizeof(*adev), GFP_KERNEL);
-	if (!adev)
-		return ERR_PTR(-ENOMEM);
-
-	adev->name = "reset-mpfs";
-	adev->dev.parent = clk_dev;
-	adev->dev.release = mpfs_reset_adev_release;
-	adev->id = 666u;
-
-	ret = auxiliary_device_init(adev);
-	if (ret) {
-		kfree(adev);
-		return ERR_PTR(ret);
-	}
-
-	return adev;
-}
-
 int mpfs_reset_controller_register(struct device *clk_dev, void __iomem *base)
 {
 	struct auxiliary_device *adev;
-	int ret;
 
-	adev = mpfs_reset_adev_alloc(clk_dev);
-	if (IS_ERR(adev))
-		return PTR_ERR(adev);
-
-	ret = auxiliary_device_add(adev);
-	if (ret) {
-		auxiliary_device_uninit(adev);
-		return ret;
-	}
-
-	adev->dev.platform_data = (__force void *)base;
+	adev = devm_auxiliary_device_create(clk_dev, "reset-mpfs",
+					    (__force void *)base);
+	if (!adev)
+		return -ENODEV;
 
-	return devm_add_action_or_reset(clk_dev, mpfs_reset_unregister_adev, adev);
+	return 0;
 }
 EXPORT_SYMBOL_NS_GPL(mpfs_reset_controller_register, "MCHP_CLK_MPFS");
 

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device
  2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
  2025-02-18 19:29 ` [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers Jerome Brunet
  2025-02-18 19:29 ` [PATCH v4 2/8] reset: mpfs: use the auxiliary device creation Jerome Brunet
@ 2025-02-18 19:29 ` Jerome Brunet
  2025-02-25 16:04   ` Doug Anderson
  2025-02-18 19:29 ` [PATCH v4 4/8] platform: arm64: lenovo-yoga-c630: use the auxiliary device creation helper Jerome Brunet
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

The auxiliary device creation of this driver is simple enough to
use the available auxiliary device creation helper.

Use it and remove some boilerplate code.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 49 +++++------------------------------
 1 file changed, 7 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 205bd0fde4f8b3400caa8507092308e50eb172b7..38bd18b14887a27a716c8798f6284649c77a761b 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -457,23 +457,6 @@ static void ti_sn65dsi86_debugfs_init(struct ti_sn65dsi86 *pdata)
  * Auxiliary Devices (*not* AUX)
  */
 
-static void ti_sn65dsi86_uninit_aux(void *data)
-{
-	auxiliary_device_uninit(data);
-}
-
-static void ti_sn65dsi86_delete_aux(void *data)
-{
-	auxiliary_device_delete(data);
-}
-
-static void ti_sn65dsi86_aux_device_release(struct device *dev)
-{
-	struct auxiliary_device *aux = container_of(dev, struct auxiliary_device, dev);
-
-	kfree(aux);
-}
-
 static int ti_sn65dsi86_add_aux_device(struct ti_sn65dsi86 *pdata,
 				       struct auxiliary_device **aux_out,
 				       const char *name)
@@ -481,34 +464,16 @@ static int ti_sn65dsi86_add_aux_device(struct ti_sn65dsi86 *pdata,
 	struct device *dev = pdata->dev;
 	const struct i2c_client *client = to_i2c_client(dev);
 	struct auxiliary_device *aux;
-	int ret;
+	int id;
 
-	aux = kzalloc(sizeof(*aux), GFP_KERNEL);
+	id = (client->adapter->nr << 10) | client->addr;
+	aux = __devm_auxiliary_device_create(dev, KBUILD_MODNAME, name,
+					     NULL, id);
 	if (!aux)
-		return -ENOMEM;
-
-	aux->name = name;
-	aux->id = (client->adapter->nr << 10) | client->addr;
-	aux->dev.parent = dev;
-	aux->dev.release = ti_sn65dsi86_aux_device_release;
-	device_set_of_node_from_dev(&aux->dev, dev);
-	ret = auxiliary_device_init(aux);
-	if (ret) {
-		kfree(aux);
-		return ret;
-	}
-	ret = devm_add_action_or_reset(dev, ti_sn65dsi86_uninit_aux, aux);
-	if (ret)
-		return ret;
-
-	ret = auxiliary_device_add(aux);
-	if (ret)
-		return ret;
-	ret = devm_add_action_or_reset(dev, ti_sn65dsi86_delete_aux, aux);
-	if (!ret)
-		*aux_out = aux;
+		return -ENODEV;
 
-	return ret;
+	*aux_out = aux;
+	return 0;
 }
 
 /* -----------------------------------------------------------------------------

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v4 4/8] platform: arm64: lenovo-yoga-c630: use the auxiliary device creation helper
  2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
                   ` (2 preceding siblings ...)
  2025-02-18 19:29 ` [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device Jerome Brunet
@ 2025-02-18 19:29 ` Jerome Brunet
  2025-02-18 19:29 ` [PATCH v4 5/8] clk: eyeq: " Jerome Brunet
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

The auxiliary device creation of this driver is simple enough to
use the available auxiliary device creation helper.

Use it and remove some boilerplate code.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/platform/arm64/lenovo-yoga-c630.c | 40 +++----------------------------
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/drivers/platform/arm64/lenovo-yoga-c630.c b/drivers/platform/arm64/lenovo-yoga-c630.c
index 1f05c9a6a89d5ee146144062f5d2e36795c56639..75060c842b249c1b4cab21fef943266ae0b31d32 100644
--- a/drivers/platform/arm64/lenovo-yoga-c630.c
+++ b/drivers/platform/arm64/lenovo-yoga-c630.c
@@ -191,50 +191,16 @@ void yoga_c630_ec_unregister_notify(struct yoga_c630_ec *ec, struct notifier_blo
 }
 EXPORT_SYMBOL_GPL(yoga_c630_ec_unregister_notify);
 
-static void yoga_c630_aux_release(struct device *dev)
-{
-	struct auxiliary_device *adev = to_auxiliary_dev(dev);
-
-	kfree(adev);
-}
-
-static void yoga_c630_aux_remove(void *data)
-{
-	struct auxiliary_device *adev = data;
-
-	auxiliary_device_delete(adev);
-	auxiliary_device_uninit(adev);
-}
-
 static int yoga_c630_aux_init(struct device *parent, const char *name,
 			      struct yoga_c630_ec *ec)
 {
 	struct auxiliary_device *adev;
-	int ret;
 
-	adev = kzalloc(sizeof(*adev), GFP_KERNEL);
+	adev = devm_auxiliary_device_create(parent, name, ec);
 	if (!adev)
-		return -ENOMEM;
-
-	adev->name = name;
-	adev->id = 0;
-	adev->dev.parent = parent;
-	adev->dev.release = yoga_c630_aux_release;
-	adev->dev.platform_data = ec;
-
-	ret = auxiliary_device_init(adev);
-	if (ret) {
-		kfree(adev);
-		return ret;
-	}
-
-	ret = auxiliary_device_add(adev);
-	if (ret) {
-		auxiliary_device_uninit(adev);
-		return ret;
-	}
+		return -ENODEV;
 
-	return devm_add_action_or_reset(parent, yoga_c630_aux_remove, adev);
+	return 0;
 }
 
 static int yoga_c630_ec_probe(struct i2c_client *client)

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v4 5/8] clk: eyeq: use the auxiliary device creation helper
  2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
                   ` (3 preceding siblings ...)
  2025-02-18 19:29 ` [PATCH v4 4/8] platform: arm64: lenovo-yoga-c630: use the auxiliary device creation helper Jerome Brunet
@ 2025-02-18 19:29 ` Jerome Brunet
  2025-02-18 19:29 ` [PATCH v4 6/8] reset: eyeq: drop device_set_of_node_from_dev() done by parent Jerome Brunet
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

The auxiliary device creation of this driver is simple enough to
use the available auxiliary device creation helper.

Use it and remove some boilerplate code.

Tested-by: Théo Lebrun <theo.lebrun@bootlin.com>  # On Mobileye EyeQ5
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/clk/clk-eyeq.c | 57 +++++++++++---------------------------------------
 1 file changed, 12 insertions(+), 45 deletions(-)

diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c
index 640c25788487f8cf6fb4431ed6fb612cf099f114..4094f34af05b488545cc87043fb3352968515a78 100644
--- a/drivers/clk/clk-eyeq.c
+++ b/drivers/clk/clk-eyeq.c
@@ -322,38 +322,18 @@ static void eqc_probe_init_fixed_factors(struct device *dev,
 	}
 }
 
-static void eqc_auxdev_release(struct device *dev)
-{
-	struct auxiliary_device *adev = to_auxiliary_dev(dev);
-
-	kfree(adev);
-}
-
-static int eqc_auxdev_create(struct device *dev, void __iomem *base,
-			     const char *name, u32 id)
+static void eqc_auxdev_create_optional(struct device *dev, void __iomem *base,
+				       const char *name)
 {
 	struct auxiliary_device *adev;
-	int ret;
-
-	adev = kzalloc(sizeof(*adev), GFP_KERNEL);
-	if (!adev)
-		return -ENOMEM;
-
-	adev->name = name;
-	adev->dev.parent = dev;
-	adev->dev.platform_data = (void __force *)base;
-	adev->dev.release = eqc_auxdev_release;
-	adev->id = id;
 
-	ret = auxiliary_device_init(adev);
-	if (ret)
-		return ret;
-
-	ret = auxiliary_device_add(adev);
-	if (ret)
-		auxiliary_device_uninit(adev);
-
-	return ret;
+	if (name) {
+		adev = devm_auxiliary_device_create(dev, name,
+						    (void __force *)base);
+		if (!adev)
+			dev_warn(dev, "failed creating auxiliary device %s.%s\n",
+				 KBUILD_MODNAME, name);
+	}
 }
 
 static int eqc_probe(struct platform_device *pdev)
@@ -365,7 +345,6 @@ static int eqc_probe(struct platform_device *pdev)
 	unsigned int i, clk_count;
 	struct resource *res;
 	void __iomem *base;
-	int ret;
 
 	data = device_get_match_data(dev);
 	if (!data)
@@ -379,21 +358,9 @@ static int eqc_probe(struct platform_device *pdev)
 	if (!base)
 		return -ENOMEM;
 
-	/* Init optional reset auxiliary device. */
-	if (data->reset_auxdev_name) {
-		ret = eqc_auxdev_create(dev, base, data->reset_auxdev_name, 0);
-		if (ret)
-			dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n",
-				 KBUILD_MODNAME, data->reset_auxdev_name, ret);
-	}
-
-	/* Init optional pinctrl auxiliary device. */
-	if (data->pinctrl_auxdev_name) {
-		ret = eqc_auxdev_create(dev, base, data->pinctrl_auxdev_name, 0);
-		if (ret)
-			dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n",
-				 KBUILD_MODNAME, data->pinctrl_auxdev_name, ret);
-	}
+	/* Init optional auxiliary devices. */
+	eqc_auxdev_create_optional(dev, base, data->reset_auxdev_name);
+	eqc_auxdev_create_optional(dev, base, data->pinctrl_auxdev_name);
 
 	if (data->pll_count + data->div_count + data->fixed_factor_count == 0)
 		return 0; /* Zero clocks, we are done. */

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v4 6/8] reset: eyeq: drop device_set_of_node_from_dev() done by parent
  2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
                   ` (4 preceding siblings ...)
  2025-02-18 19:29 ` [PATCH v4 5/8] clk: eyeq: " Jerome Brunet
@ 2025-02-18 19:29 ` Jerome Brunet
  2025-02-19  9:16   ` Philipp Zabel
  2025-02-18 19:29 ` [PATCH v4 7/8] clk: clk-imx8mp-audiomix: use the auxiliary device creation helper Jerome Brunet
  2025-02-18 19:29 ` [PATCH v4 8/8] clk: amlogic: axg-audio: use the auxiliary reset driver - take 2 Jerome Brunet
  7 siblings, 1 reply; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

From: Théo Lebrun <theo.lebrun@bootlin.com>

Our parent driver (clk-eyeq) now does the
	device_set_of_node_from_dev(dev, dev->parent)
call through the newly introduced devm_auxiliary_device_create() helper.

Doing it again in the reset-eyeq probe would be redundant.
Drop both the WARN_ON() and the device_set_of_node_from_dev() call.
Also fix the following comment that talks about "our newfound OF node".

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/reset/reset-eyeq.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/reset/reset-eyeq.c b/drivers/reset/reset-eyeq.c
index 02d50041048b42921e3e511148cd29f215b5fc5e..8018fa895427bb1e51ea23b99803dc7fe6108421 100644
--- a/drivers/reset/reset-eyeq.c
+++ b/drivers/reset/reset-eyeq.c
@@ -420,17 +420,8 @@ static int eqr_probe(struct auxiliary_device *adev,
 	int ret;
 
 	/*
-	 * We are an auxiliary device of clk-eyeq. We do not have an OF node by
-	 * default; let's reuse our parent's OF node.
-	 */
-	WARN_ON(dev->of_node);
-	device_set_of_node_from_dev(dev, dev->parent);
-	if (!dev->of_node)
-		return -ENODEV;
-
-	/*
-	 * Using our newfound OF node, we can get match data. We cannot use
-	 * device_get_match_data() because it does not match reused OF nodes.
+	 * Get match data. We cannot use device_get_match_data() because it does
+	 * not accept reused OF nodes; see device_set_of_node_from_dev().
 	 */
 	match = of_match_node(dev->driver->of_match_table, dev->of_node);
 	if (!match || !match->data)

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v4 7/8] clk: clk-imx8mp-audiomix: use the auxiliary device creation helper
  2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
                   ` (5 preceding siblings ...)
  2025-02-18 19:29 ` [PATCH v4 6/8] reset: eyeq: drop device_set_of_node_from_dev() done by parent Jerome Brunet
@ 2025-02-18 19:29 ` Jerome Brunet
  2025-02-18 19:29 ` [PATCH v4 8/8] clk: amlogic: axg-audio: use the auxiliary reset driver - take 2 Jerome Brunet
  7 siblings, 0 replies; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

The auxiliary device creation of this driver is simple enough to
use the available auxiliary device creation helper.

Use it and remove some boilerplate code.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/clk/imx/clk-imx8mp-audiomix.c | 49 ++++++-----------------------------
 1 file changed, 8 insertions(+), 41 deletions(-)

diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/imx/clk-imx8mp-audiomix.c
index c409fc7e061869988f83c7df3ef7860500426323..fa15a5ed59e304687317b5a23c845a0588890bee 100644
--- a/drivers/clk/imx/clk-imx8mp-audiomix.c
+++ b/drivers/clk/imx/clk-imx8mp-audiomix.c
@@ -230,61 +230,28 @@ struct clk_imx8mp_audiomix_priv {
 
 #if IS_ENABLED(CONFIG_RESET_CONTROLLER)
 
-static void clk_imx8mp_audiomix_reset_unregister_adev(void *_adev)
+static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev)
 {
-	struct auxiliary_device *adev = _adev;
-
-	auxiliary_device_delete(adev);
-	auxiliary_device_uninit(adev);
-}
-
-static void clk_imx8mp_audiomix_reset_adev_release(struct device *dev)
-{
-	struct auxiliary_device *adev = to_auxiliary_dev(dev);
-
-	kfree(adev);
-}
-
-static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,
-							 struct clk_imx8mp_audiomix_priv *priv)
-{
-	struct auxiliary_device *adev __free(kfree) = NULL;
-	int ret;
+	struct auxiliary_device *adev;
 
 	if (!of_property_present(dev->of_node, "#reset-cells"))
 		return 0;
 
-	adev = kzalloc(sizeof(*adev), GFP_KERNEL);
+	adev = devm_auxiliary_device_create(dev, "reset", NULL);
 	if (!adev)
-		return -ENOMEM;
-
-	adev->name = "reset";
-	adev->dev.parent = dev;
-	adev->dev.release = clk_imx8mp_audiomix_reset_adev_release;
-
-	ret = auxiliary_device_init(adev);
-	if (ret)
-		return ret;
+		return -ENODEV;
 
-	ret = auxiliary_device_add(adev);
-	if (ret) {
-		auxiliary_device_uninit(adev);
-		return ret;
-	}
-
-	return devm_add_action_or_reset(dev, clk_imx8mp_audiomix_reset_unregister_adev,
-					no_free_ptr(adev));
+	return 0;
 }
 
 #else /* !CONFIG_RESET_CONTROLLER */
 
-static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,
-							 struct clk_imx8mp_audiomix_priv *priv)
+static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev)
 {
 	return 0;
 }
 
-#endif /* !CONFIG_RESET_CONTROLLER */
+#endif
 
 static void clk_imx8mp_audiomix_save_restore(struct device *dev, bool save)
 {
@@ -408,7 +375,7 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_clk_register;
 
-	ret = clk_imx8mp_audiomix_reset_controller_register(dev, priv);
+	ret = clk_imx8mp_audiomix_reset_controller_register(dev);
 	if (ret)
 		goto err_clk_register;
 

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v4 8/8] clk: amlogic: axg-audio: use the auxiliary reset driver - take 2
  2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
                   ` (6 preceding siblings ...)
  2025-02-18 19:29 ` [PATCH v4 7/8] clk: clk-imx8mp-audiomix: use the auxiliary device creation helper Jerome Brunet
@ 2025-02-18 19:29 ` Jerome Brunet
  7 siblings, 0 replies; 25+ messages in thread
From: Jerome Brunet @ 2025-02-18 19:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

Remove the implementation of the reset driver in axg audio
clock driver and migrate to the one provided by reset framework
on the auxiliary bus.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/clk/meson/Kconfig     |   2 +-
 drivers/clk/meson/axg-audio.c | 114 +++++-------------------------------------
 2 files changed, 14 insertions(+), 102 deletions(-)

diff --git a/drivers/clk/meson/Kconfig b/drivers/clk/meson/Kconfig
index be2e3a5f83363b07cdcec2601acf15780ff24892..7cb21fc223b063cb93812643f02f192343981ed8 100644
--- a/drivers/clk/meson/Kconfig
+++ b/drivers/clk/meson/Kconfig
@@ -106,7 +106,7 @@ config COMMON_CLK_AXG_AUDIO
 	select COMMON_CLK_MESON_SCLK_DIV
 	select COMMON_CLK_MESON_CLKC_UTILS
 	select REGMAP_MMIO
-	select RESET_CONTROLLER
+	imply RESET_MESON_AUX
 	help
 	  Support for the audio clock controller on AmLogic A113D devices,
 	  aka axg, Say Y if you want audio subsystem to work.
diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
index 9df627b142f89788966ede0262aaaf39e13f0b49..3948f5d0faca372dd5cc4ed6dc95f9c89fe5bae8 100644
--- a/drivers/clk/meson/axg-audio.c
+++ b/drivers/clk/meson/axg-audio.c
@@ -4,6 +4,7 @@
  * Author: Jerome Brunet <jbrunet@baylibre.com>
  */
 
+#include <linux/auxiliary_bus.h>
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/init.h>
@@ -12,7 +13,6 @@
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
-#include <linux/reset-controller.h>
 #include <linux/slab.h>
 
 #include "meson-clkc-utils.h"
@@ -1678,84 +1678,6 @@ static struct clk_regmap *const sm1_clk_regmaps[] = {
 	&sm1_earcrx_dmac_clk,
 };
 
-struct axg_audio_reset_data {
-	struct reset_controller_dev rstc;
-	struct regmap *map;
-	unsigned int offset;
-};
-
-static void axg_audio_reset_reg_and_bit(struct axg_audio_reset_data *rst,
-					unsigned long id,
-					unsigned int *reg,
-					unsigned int *bit)
-{
-	unsigned int stride = regmap_get_reg_stride(rst->map);
-
-	*reg = (id / (stride * BITS_PER_BYTE)) * stride;
-	*reg += rst->offset;
-	*bit = id % (stride * BITS_PER_BYTE);
-}
-
-static int axg_audio_reset_update(struct reset_controller_dev *rcdev,
-				unsigned long id, bool assert)
-{
-	struct axg_audio_reset_data *rst =
-		container_of(rcdev, struct axg_audio_reset_data, rstc);
-	unsigned int offset, bit;
-
-	axg_audio_reset_reg_and_bit(rst, id, &offset, &bit);
-
-	regmap_update_bits(rst->map, offset, BIT(bit),
-			assert ? BIT(bit) : 0);
-
-	return 0;
-}
-
-static int axg_audio_reset_status(struct reset_controller_dev *rcdev,
-				unsigned long id)
-{
-	struct axg_audio_reset_data *rst =
-		container_of(rcdev, struct axg_audio_reset_data, rstc);
-	unsigned int val, offset, bit;
-
-	axg_audio_reset_reg_and_bit(rst, id, &offset, &bit);
-
-	regmap_read(rst->map, offset, &val);
-
-	return !!(val & BIT(bit));
-}
-
-static int axg_audio_reset_assert(struct reset_controller_dev *rcdev,
-				unsigned long id)
-{
-	return axg_audio_reset_update(rcdev, id, true);
-}
-
-static int axg_audio_reset_deassert(struct reset_controller_dev *rcdev,
-				unsigned long id)
-{
-	return axg_audio_reset_update(rcdev, id, false);
-}
-
-static int axg_audio_reset_toggle(struct reset_controller_dev *rcdev,
-				unsigned long id)
-{
-	int ret;
-
-	ret = axg_audio_reset_assert(rcdev, id);
-	if (ret)
-		return ret;
-
-	return axg_audio_reset_deassert(rcdev, id);
-}
-
-static const struct reset_control_ops axg_audio_rstc_ops = {
-	.assert = axg_audio_reset_assert,
-	.deassert = axg_audio_reset_deassert,
-	.reset = axg_audio_reset_toggle,
-	.status = axg_audio_reset_status,
-};
-
 static struct regmap_config axg_audio_regmap_cfg = {
 	.reg_bits	= 32,
 	.val_bits	= 32,
@@ -1766,8 +1688,7 @@ struct audioclk_data {
 	struct clk_regmap *const *regmap_clks;
 	unsigned int regmap_clk_num;
 	struct meson_clk_hw_data hw_clks;
-	unsigned int reset_offset;
-	unsigned int reset_num;
+	const char *rst_drvname;
 	unsigned int max_register;
 };
 
@@ -1775,7 +1696,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	const struct audioclk_data *data;
-	struct axg_audio_reset_data *rst;
+	struct auxiliary_device *auxdev;
 	struct regmap *map;
 	void __iomem *regs;
 	struct clk_hw *hw;
@@ -1834,22 +1755,15 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	/* Stop here if there is no reset */
-	if (!data->reset_num)
-		return 0;
-
-	rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL);
-	if (!rst)
-		return -ENOMEM;
-
-	rst->map = map;
-	rst->offset = data->reset_offset;
-	rst->rstc.nr_resets = data->reset_num;
-	rst->rstc.ops = &axg_audio_rstc_ops;
-	rst->rstc.of_node = dev->of_node;
-	rst->rstc.owner = THIS_MODULE;
+	/* Register auxiliary reset driver when applicable */
+	if (data->rst_drvname) {
+		auxdev = __devm_auxiliary_device_create(dev, dev->driver->name,
+							data->rst_drvname, NULL, 0);
+		if (!auxdev)
+			return -ENODEV;
+	}
 
-	return devm_reset_controller_register(dev, &rst->rstc);
+	return 0;
 }
 
 static const struct audioclk_data axg_audioclk_data = {
@@ -1869,8 +1783,7 @@ static const struct audioclk_data g12a_audioclk_data = {
 		.hws = g12a_audio_hw_clks,
 		.num = ARRAY_SIZE(g12a_audio_hw_clks),
 	},
-	.reset_offset = AUDIO_SW_RESET,
-	.reset_num = 26,
+	.rst_drvname = "rst-g12a",
 	.max_register = AUDIO_CLK_SPDIFOUT_B_CTRL,
 };
 
@@ -1881,8 +1794,7 @@ static const struct audioclk_data sm1_audioclk_data = {
 		.hws = sm1_audio_hw_clks,
 		.num = ARRAY_SIZE(sm1_audio_hw_clks),
 	},
-	.reset_offset = AUDIO_SM1_SW_RESET0,
-	.reset_num = 39,
+	.rst_drvname = "rst-sm1",
 	.max_register = AUDIO_EARCRX_DMAC_CLK_CTRL,
 };
 

-- 
2.47.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-02-18 19:29 ` [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers Jerome Brunet
@ 2025-02-19  9:06   ` Dmitry Baryshkov
  2025-02-19 10:13     ` Greg Kroah-Hartman
  2025-02-19 14:20   ` Greg Kroah-Hartman
  2025-02-20 19:14   ` Ira Weiny
  2 siblings, 1 reply; 25+ messages in thread
From: Dmitry Baryshkov @ 2025-02-19  9:06 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl, linux-kernel,
	linux-riscv, dri-devel, platform-driver-x86, linux-mips,
	linux-clk, imx, linux-arm-kernel, linux-amlogic

On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
> Add helper functions to create a device on the auxiliary bus.
> 
> This is meant for fairly simple usage of the auxiliary bus, to avoid having
> the same code repeated in the different drivers.
> 
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  drivers/base/auxiliary.c      | 108 ++++++++++++++++++++++++++++++++++++++++++
>  include/linux/auxiliary_bus.h |  17 +++++++
>  2 files changed, 125 insertions(+)
> 
> diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
> index afa4df4c5a3f371b91d8dd8c4325495d32ad1291..a6d46c2759be81a0739f07528d5959c2a76eb8a8 100644
> --- a/drivers/base/auxiliary.c
> +++ b/drivers/base/auxiliary.c
> @@ -385,6 +385,114 @@ void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv)
>  }
>  EXPORT_SYMBOL_GPL(auxiliary_driver_unregister);
>  
> +static void auxiliary_device_release(struct device *dev)
> +{
> +	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
> +
> +	kfree(auxdev);
> +}
> +
> +/**
> + * auxiliary_device_create - create a device on the auxiliary bus
> + * @dev: parent device
> + * @modname: module name used to create the auxiliary driver name.
> + * @devname: auxiliary bus device name
> + * @platform_data: auxiliary bus device platform data
> + * @id: auxiliary bus device id
> + *
> + * Helper to create an auxiliary bus device.
> + * The device created matches driver 'modname.devname' on the auxiliary bus.
> + */
> +struct auxiliary_device *auxiliary_device_create(struct device *dev,
> +						 const char *modname,
> +						 const char *devname,
> +						 void *platform_data,
> +						 int id)
> +{
> +	struct auxiliary_device *auxdev;
> +	int ret;
> +
> +	auxdev = kzalloc(sizeof(*auxdev), GFP_KERNEL);
> +	if (!auxdev)
> +		return NULL;
> +
> +	auxdev->id = id;
> +	auxdev->name = devname;
> +	auxdev->dev.parent = dev;
> +	auxdev->dev.platform_data = platform_data;
> +	auxdev->dev.release = auxiliary_device_release;
> +	device_set_of_node_from_dev(&auxdev->dev, dev);
> +
> +	ret = auxiliary_device_init(auxdev);
> +	if (ret) {
> +		kfree(auxdev);
> +		return NULL;
> +	}
> +
> +	ret = __auxiliary_device_add(auxdev, modname);
> +	if (ret) {

This loses possible error return values from __auxiliary_device_add().
I'd suggest to return ERR_PTR(ret) here and in the
auxiliary_device_init() chunks and ERR_PTR(-ENOMEM) in case of kzalloc()
failure.

> +		/*
> +		 * It may look odd but auxdev should not be freed here.
> +		 * auxiliary_device_uninit() calls device_put() which call
> +		 * the device release function, freeing auxdev.
> +		 */
> +		auxiliary_device_uninit(auxdev);
> +		return NULL;
> +	}
> +
> +	return auxdev;
> +}
> +EXPORT_SYMBOL_GPL(auxiliary_device_create);
> +

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 2/8] reset: mpfs: use the auxiliary device creation
  2025-02-18 19:29 ` [PATCH v4 2/8] reset: mpfs: use the auxiliary device creation Jerome Brunet
@ 2025-02-19  9:16   ` Philipp Zabel
  0 siblings, 0 replies; 25+ messages in thread
From: Philipp Zabel @ 2025-02-19  9:16 UTC (permalink / raw)
  To: Jerome Brunet, Greg Kroah-Hartman, Dave Ertman, Ira Weiny,
	Rafael J. Wysocki, Stephen Boyd, Arnd Bergmann, Danilo Krummrich,
	Conor Dooley, Daire McNamara, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic

On Di, 2025-02-18 at 20:29 +0100, Jerome Brunet wrote:
> The auxiliary device creation of this driver is simple enough to
> use the available auxiliary device creation helper.
> 
> Use it and remove some boilerplate code.
> 
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 6/8] reset: eyeq: drop device_set_of_node_from_dev() done by parent
  2025-02-18 19:29 ` [PATCH v4 6/8] reset: eyeq: drop device_set_of_node_from_dev() done by parent Jerome Brunet
@ 2025-02-19  9:16   ` Philipp Zabel
  0 siblings, 0 replies; 25+ messages in thread
From: Philipp Zabel @ 2025-02-19  9:16 UTC (permalink / raw)
  To: Jerome Brunet, Greg Kroah-Hartman, Dave Ertman, Ira Weiny,
	Rafael J. Wysocki, Stephen Boyd, Arnd Bergmann, Danilo Krummrich,
	Conor Dooley, Daire McNamara, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic

On Di, 2025-02-18 at 20:29 +0100, Jerome Brunet wrote:
> From: Théo Lebrun <theo.lebrun@bootlin.com>
> 
> Our parent driver (clk-eyeq) now does the
> 	device_set_of_node_from_dev(dev, dev->parent)
> call through the newly introduced devm_auxiliary_device_create() helper.
> 
> Doing it again in the reset-eyeq probe would be redundant.
> Drop both the WARN_ON() and the device_set_of_node_from_dev() call.
> Also fix the following comment that talks about "our newfound OF node".
> 
> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-02-19  9:06   ` Dmitry Baryshkov
@ 2025-02-19 10:13     ` Greg Kroah-Hartman
  2025-02-19 12:08       ` Dmitry Baryshkov
  0 siblings, 1 reply; 25+ messages in thread
From: Greg Kroah-Hartman @ 2025-02-19 10:13 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Jerome Brunet, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl, linux-kernel,
	linux-riscv, dri-devel, platform-driver-x86, linux-mips,
	linux-clk, imx, linux-arm-kernel, linux-amlogic

On Wed, Feb 19, 2025 at 11:06:02AM +0200, Dmitry Baryshkov wrote:
> On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
> > Add helper functions to create a device on the auxiliary bus.
> > 
> > This is meant for fairly simple usage of the auxiliary bus, to avoid having
> > the same code repeated in the different drivers.
> > 
> > Suggested-by: Stephen Boyd <sboyd@kernel.org>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > ---
> >  drivers/base/auxiliary.c      | 108 ++++++++++++++++++++++++++++++++++++++++++
> >  include/linux/auxiliary_bus.h |  17 +++++++
> >  2 files changed, 125 insertions(+)
> > 
> > diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
> > index afa4df4c5a3f371b91d8dd8c4325495d32ad1291..a6d46c2759be81a0739f07528d5959c2a76eb8a8 100644
> > --- a/drivers/base/auxiliary.c
> > +++ b/drivers/base/auxiliary.c
> > @@ -385,6 +385,114 @@ void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv)
> >  }
> >  EXPORT_SYMBOL_GPL(auxiliary_driver_unregister);
> >  
> > +static void auxiliary_device_release(struct device *dev)
> > +{
> > +	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
> > +
> > +	kfree(auxdev);
> > +}
> > +
> > +/**
> > + * auxiliary_device_create - create a device on the auxiliary bus
> > + * @dev: parent device
> > + * @modname: module name used to create the auxiliary driver name.
> > + * @devname: auxiliary bus device name
> > + * @platform_data: auxiliary bus device platform data
> > + * @id: auxiliary bus device id
> > + *
> > + * Helper to create an auxiliary bus device.
> > + * The device created matches driver 'modname.devname' on the auxiliary bus.
> > + */
> > +struct auxiliary_device *auxiliary_device_create(struct device *dev,
> > +						 const char *modname,
> > +						 const char *devname,
> > +						 void *platform_data,
> > +						 int id)
> > +{
> > +	struct auxiliary_device *auxdev;
> > +	int ret;
> > +
> > +	auxdev = kzalloc(sizeof(*auxdev), GFP_KERNEL);
> > +	if (!auxdev)
> > +		return NULL;
> > +
> > +	auxdev->id = id;
> > +	auxdev->name = devname;
> > +	auxdev->dev.parent = dev;
> > +	auxdev->dev.platform_data = platform_data;
> > +	auxdev->dev.release = auxiliary_device_release;
> > +	device_set_of_node_from_dev(&auxdev->dev, dev);
> > +
> > +	ret = auxiliary_device_init(auxdev);
> > +	if (ret) {
> > +		kfree(auxdev);
> > +		return NULL;
> > +	}
> > +
> > +	ret = __auxiliary_device_add(auxdev, modname);
> > +	if (ret) {
> 
> This loses possible error return values from __auxiliary_device_add().

Why does that really matter?

> I'd suggest to return ERR_PTR(ret) here and in the
> auxiliary_device_init() chunks and ERR_PTR(-ENOMEM) in case of kzalloc()
> failure.

Will the caller do something different based on the error value here?
All we care is that this worked or not, the specific error isn't going
to matter for device creation like this.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-02-19 10:13     ` Greg Kroah-Hartman
@ 2025-02-19 12:08       ` Dmitry Baryshkov
  2025-02-19 13:19         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Baryshkov @ 2025-02-19 12:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jerome Brunet, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl, linux-kernel,
	linux-riscv, dri-devel, platform-driver-x86, linux-mips,
	linux-clk, imx, linux-arm-kernel, linux-amlogic

On Wed, Feb 19, 2025 at 11:13:14AM +0100, Greg Kroah-Hartman wrote:
> On Wed, Feb 19, 2025 at 11:06:02AM +0200, Dmitry Baryshkov wrote:
> > On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
> > > Add helper functions to create a device on the auxiliary bus.
> > > 
> > > This is meant for fairly simple usage of the auxiliary bus, to avoid having
> > > the same code repeated in the different drivers.
> > > 
> > > Suggested-by: Stephen Boyd <sboyd@kernel.org>
> > > Cc: Arnd Bergmann <arnd@arndb.de>
> > > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > > ---
> > >  drivers/base/auxiliary.c      | 108 ++++++++++++++++++++++++++++++++++++++++++
> > >  include/linux/auxiliary_bus.h |  17 +++++++
> > >  2 files changed, 125 insertions(+)
> > > 
> > > diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
> > > index afa4df4c5a3f371b91d8dd8c4325495d32ad1291..a6d46c2759be81a0739f07528d5959c2a76eb8a8 100644
> > > --- a/drivers/base/auxiliary.c
> > > +++ b/drivers/base/auxiliary.c
> > > @@ -385,6 +385,114 @@ void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv)
> > >  }
> > >  EXPORT_SYMBOL_GPL(auxiliary_driver_unregister);
> > >  
> > > +static void auxiliary_device_release(struct device *dev)
> > > +{
> > > +	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
> > > +
> > > +	kfree(auxdev);
> > > +}
> > > +
> > > +/**
> > > + * auxiliary_device_create - create a device on the auxiliary bus
> > > + * @dev: parent device
> > > + * @modname: module name used to create the auxiliary driver name.
> > > + * @devname: auxiliary bus device name
> > > + * @platform_data: auxiliary bus device platform data
> > > + * @id: auxiliary bus device id
> > > + *
> > > + * Helper to create an auxiliary bus device.
> > > + * The device created matches driver 'modname.devname' on the auxiliary bus.
> > > + */
> > > +struct auxiliary_device *auxiliary_device_create(struct device *dev,
> > > +						 const char *modname,
> > > +						 const char *devname,
> > > +						 void *platform_data,
> > > +						 int id)
> > > +{
> > > +	struct auxiliary_device *auxdev;
> > > +	int ret;
> > > +
> > > +	auxdev = kzalloc(sizeof(*auxdev), GFP_KERNEL);
> > > +	if (!auxdev)
> > > +		return NULL;
> > > +
> > > +	auxdev->id = id;
> > > +	auxdev->name = devname;
> > > +	auxdev->dev.parent = dev;
> > > +	auxdev->dev.platform_data = platform_data;
> > > +	auxdev->dev.release = auxiliary_device_release;
> > > +	device_set_of_node_from_dev(&auxdev->dev, dev);
> > > +
> > > +	ret = auxiliary_device_init(auxdev);
> > > +	if (ret) {
> > > +		kfree(auxdev);
> > > +		return NULL;
> > > +	}
> > > +
> > > +	ret = __auxiliary_device_add(auxdev, modname);
> > > +	if (ret) {
> > 
> > This loses possible error return values from __auxiliary_device_add().
> 
> Why does that really matter?

At the very least the caller (or caller of a caller) can call
dev_err_probe() or dev_err("%pe"). With the current implementation as
everybody maps NULL to -ENOMEM the error message will be cryptic.

Or just having a cryptic value in the logs.

> > I'd suggest to return ERR_PTR(ret) here and in the
> > auxiliary_device_init() chunks and ERR_PTR(-ENOMEM) in case of kzalloc()
> > failure.
> 
> Will the caller do something different based on the error value here?
> All we care is that this worked or not, the specific error isn't going
> to matter for device creation like this.

The caller might not, the developer might.

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-02-19 12:08       ` Dmitry Baryshkov
@ 2025-02-19 13:19         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2025-02-19 13:19 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Jerome Brunet, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Douglas Anderson, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl, linux-kernel,
	linux-riscv, dri-devel, platform-driver-x86, linux-mips,
	linux-clk, imx, linux-arm-kernel, linux-amlogic

On Wed, Feb 19, 2025 at 02:08:22PM +0200, Dmitry Baryshkov wrote:
> On Wed, Feb 19, 2025 at 11:13:14AM +0100, Greg Kroah-Hartman wrote:
> > On Wed, Feb 19, 2025 at 11:06:02AM +0200, Dmitry Baryshkov wrote:
> > > On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
> > > > Add helper functions to create a device on the auxiliary bus.
> > > > 
> > > > This is meant for fairly simple usage of the auxiliary bus, to avoid having
> > > > the same code repeated in the different drivers.
> > > > 
> > > > Suggested-by: Stephen Boyd <sboyd@kernel.org>
> > > > Cc: Arnd Bergmann <arnd@arndb.de>
> > > > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > > > ---
> > > >  drivers/base/auxiliary.c      | 108 ++++++++++++++++++++++++++++++++++++++++++
> > > >  include/linux/auxiliary_bus.h |  17 +++++++
> > > >  2 files changed, 125 insertions(+)
> > > > 
> > > > diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
> > > > index afa4df4c5a3f371b91d8dd8c4325495d32ad1291..a6d46c2759be81a0739f07528d5959c2a76eb8a8 100644
> > > > --- a/drivers/base/auxiliary.c
> > > > +++ b/drivers/base/auxiliary.c
> > > > @@ -385,6 +385,114 @@ void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv)
> > > >  }
> > > >  EXPORT_SYMBOL_GPL(auxiliary_driver_unregister);
> > > >  
> > > > +static void auxiliary_device_release(struct device *dev)
> > > > +{
> > > > +	struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
> > > > +
> > > > +	kfree(auxdev);
> > > > +}
> > > > +
> > > > +/**
> > > > + * auxiliary_device_create - create a device on the auxiliary bus
> > > > + * @dev: parent device
> > > > + * @modname: module name used to create the auxiliary driver name.
> > > > + * @devname: auxiliary bus device name
> > > > + * @platform_data: auxiliary bus device platform data
> > > > + * @id: auxiliary bus device id
> > > > + *
> > > > + * Helper to create an auxiliary bus device.
> > > > + * The device created matches driver 'modname.devname' on the auxiliary bus.
> > > > + */
> > > > +struct auxiliary_device *auxiliary_device_create(struct device *dev,
> > > > +						 const char *modname,
> > > > +						 const char *devname,
> > > > +						 void *platform_data,
> > > > +						 int id)
> > > > +{
> > > > +	struct auxiliary_device *auxdev;
> > > > +	int ret;
> > > > +
> > > > +	auxdev = kzalloc(sizeof(*auxdev), GFP_KERNEL);
> > > > +	if (!auxdev)
> > > > +		return NULL;
> > > > +
> > > > +	auxdev->id = id;
> > > > +	auxdev->name = devname;
> > > > +	auxdev->dev.parent = dev;
> > > > +	auxdev->dev.platform_data = platform_data;
> > > > +	auxdev->dev.release = auxiliary_device_release;
> > > > +	device_set_of_node_from_dev(&auxdev->dev, dev);
> > > > +
> > > > +	ret = auxiliary_device_init(auxdev);
> > > > +	if (ret) {
> > > > +		kfree(auxdev);
> > > > +		return NULL;
> > > > +	}
> > > > +
> > > > +	ret = __auxiliary_device_add(auxdev, modname);
> > > > +	if (ret) {
> > > 
> > > This loses possible error return values from __auxiliary_device_add().
> > 
> > Why does that really matter?
> 
> At the very least the caller (or caller of a caller) can call
> dev_err_probe() or dev_err("%pe"). With the current implementation as
> everybody maps NULL to -ENOMEM the error message will be cryptic.
> 
> Or just having a cryptic value in the logs.

So all you can get here could be:
	-ENOMEM - memory couldn't be allocated somewhere
	-EINVAL - wrong parameters sent to auxiliary_device_init() or __auxiliary_device_add()
	-EEXIST - duplicate name

And if -EEXIST happens, you will get a kernel log splat from sysfs
showing you that something went wrong.

So while I understand the need to be specific here in reporting the
exact error, I fail to understand how it really matters at all.  A
driver writer really only wants to know "did it work?" and have a simple
way to test it.

IS_ERR_OR_NULL() and then getting the error using PTR_ERR() is rough and
feels like boilerplate code that everyone gets wrong (how many times do
people accidentally only check for NULL?).

Anyway, I'm for simple apis, and NULL or valid pointer seems simple to
me.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-02-18 19:29 ` [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers Jerome Brunet
  2025-02-19  9:06   ` Dmitry Baryshkov
@ 2025-02-19 14:20   ` Greg Kroah-Hartman
  2025-04-15 12:52     ` Jerome Brunet
  2025-02-20 19:14   ` Ira Weiny
  2 siblings, 1 reply; 25+ messages in thread
From: Greg Kroah-Hartman @ 2025-02-19 14:20 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Dave Ertman, Ira Weiny, Rafael J. Wysocki, Stephen Boyd,
	Arnd Bergmann, Danilo Krummrich, Conor Dooley, Daire McNamara,
	Philipp Zabel, Douglas Anderson, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
> Add helper functions to create a device on the auxiliary bus.
> 
> This is meant for fairly simple usage of the auxiliary bus, to avoid having
> the same code repeated in the different drivers.
> 
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-02-18 19:29 ` [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers Jerome Brunet
  2025-02-19  9:06   ` Dmitry Baryshkov
  2025-02-19 14:20   ` Greg Kroah-Hartman
@ 2025-02-20 19:14   ` Ira Weiny
  2 siblings, 0 replies; 25+ messages in thread
From: Ira Weiny @ 2025-02-20 19:14 UTC (permalink / raw)
  To: Jerome Brunet, Greg Kroah-Hartman, Dave Ertman, Ira Weiny,
	Rafael J. Wysocki, Stephen Boyd, Arnd Bergmann, Danilo Krummrich,
	Conor Dooley, Daire McNamara, Philipp Zabel, Douglas Anderson,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Hans de Goede,
	Ilpo Järvinen, Bryan O'Donoghue, Vladimir Kondratiev,
	Gregory CLEMENT, Théo Lebrun, Michael Turquette, Abel Vesa,
	Peng Fan, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Kevin Hilman, Martin Blumenstingl
  Cc: linux-kernel, linux-riscv, dri-devel, platform-driver-x86,
	linux-mips, linux-clk, imx, linux-arm-kernel, linux-amlogic,
	Jerome Brunet

Jerome Brunet wrote:
> Add helper functions to create a device on the auxiliary bus.
> 
> This is meant for fairly simple usage of the auxiliary bus, to avoid having
> the same code repeated in the different drivers.
> 
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> Cc: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

[snip]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device
  2025-02-18 19:29 ` [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device Jerome Brunet
@ 2025-02-25 16:04   ` Doug Anderson
  2025-06-09 13:02     ` Jerome Brunet
  0 siblings, 1 reply; 25+ messages in thread
From: Doug Anderson @ 2025-02-25 16:04 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

Hi,

On Tue, Feb 18, 2025 at 11:30 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
>
> The auxiliary device creation of this driver is simple enough to
> use the available auxiliary device creation helper.
>
> Use it and remove some boilerplate code.
>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 49 +++++------------------------------
>  1 file changed, 7 insertions(+), 42 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

I'll snooze this for a bunch of weeks and check back to see if this
can be landed in drm-misc-next every once in a while. If you notice
that drm-misc-next has the necessary patches before I do then feel
free to poke me and I'll commit it.

-Doug

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-02-19 14:20   ` Greg Kroah-Hartman
@ 2025-04-15 12:52     ` Jerome Brunet
  2025-04-15 12:59       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 25+ messages in thread
From: Jerome Brunet @ 2025-04-15 12:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dave Ertman, Ira Weiny, Rafael J. Wysocki, Stephen Boyd,
	Arnd Bergmann, Danilo Krummrich, Conor Dooley, Daire McNamara,
	Philipp Zabel, Douglas Anderson, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

On Wed 19 Feb 2025 at 15:20, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
>> Add helper functions to create a device on the auxiliary bus.
>> 
>> This is meant for fairly simple usage of the auxiliary bus, to avoid having
>> the same code repeated in the different drivers.
>> 
>> Suggested-by: Stephen Boyd <sboyd@kernel.org>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Hey Greg,

Do you need me to do something else on this topic ?

Cheers

-- 
Jerome

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-04-15 12:52     ` Jerome Brunet
@ 2025-04-15 12:59       ` Greg Kroah-Hartman
  2025-04-15 13:10         ` Jerome Brunet
  0 siblings, 1 reply; 25+ messages in thread
From: Greg Kroah-Hartman @ 2025-04-15 12:59 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Dave Ertman, Ira Weiny, Rafael J. Wysocki, Stephen Boyd,
	Arnd Bergmann, Danilo Krummrich, Conor Dooley, Daire McNamara,
	Philipp Zabel, Douglas Anderson, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

On Tue, Apr 15, 2025 at 02:52:47PM +0200, Jerome Brunet wrote:
> On Wed 19 Feb 2025 at 15:20, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> 
> > On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
> >> Add helper functions to create a device on the auxiliary bus.
> >> 
> >> This is meant for fairly simple usage of the auxiliary bus, to avoid having
> >> the same code repeated in the different drivers.
> >> 
> >> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> >> Cc: Arnd Bergmann <arnd@arndb.de>
> >> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> >
> > Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Hey Greg,
> 
> Do you need me to do something else on this topic ?

I don't know what tree it is going through, do you?  If you want me to
take in the driver-core tree, just let me know.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-04-15 12:59       ` Greg Kroah-Hartman
@ 2025-04-15 13:10         ` Jerome Brunet
  2025-04-15 13:22           ` Greg Kroah-Hartman
  0 siblings, 1 reply; 25+ messages in thread
From: Jerome Brunet @ 2025-04-15 13:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dave Ertman, Ira Weiny, Rafael J. Wysocki, Stephen Boyd,
	Arnd Bergmann, Danilo Krummrich, Conor Dooley, Daire McNamara,
	Philipp Zabel, Douglas Anderson, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

On Tue 15 Apr 2025 at 14:59, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Tue, Apr 15, 2025 at 02:52:47PM +0200, Jerome Brunet wrote:
>> On Wed 19 Feb 2025 at 15:20, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>> 
>> > On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
>> >> Add helper functions to create a device on the auxiliary bus.
>> >> 
>> >> This is meant for fairly simple usage of the auxiliary bus, to avoid having
>> >> the same code repeated in the different drivers.
>> >> 
>> >> Suggested-by: Stephen Boyd <sboyd@kernel.org>
>> >> Cc: Arnd Bergmann <arnd@arndb.de>
>> >> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> >
>> > Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> 
>> Hey Greg,
>> 
>> Do you need me to do something else on this topic ?
>
> I don't know what tree it is going through, do you?  If you want me to
> take in the driver-core tree, just let me know.

For patch #1, I think driver-core would be appropriate, unless there is
something more specific for the auxiliary device support ?

I'll wait for this sink into an rc1, then resubmit the different driver
changes to the appropriate tree, no rush.

>
> thanks,
>
> greg k-h

-- 
Jerome

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers
  2025-04-15 13:10         ` Jerome Brunet
@ 2025-04-15 13:22           ` Greg Kroah-Hartman
  0 siblings, 0 replies; 25+ messages in thread
From: Greg Kroah-Hartman @ 2025-04-15 13:22 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Dave Ertman, Ira Weiny, Rafael J. Wysocki, Stephen Boyd,
	Arnd Bergmann, Danilo Krummrich, Conor Dooley, Daire McNamara,
	Philipp Zabel, Douglas Anderson, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

On Tue, Apr 15, 2025 at 03:10:38PM +0200, Jerome Brunet wrote:
> On Tue 15 Apr 2025 at 14:59, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> 
> > On Tue, Apr 15, 2025 at 02:52:47PM +0200, Jerome Brunet wrote:
> >> On Wed 19 Feb 2025 at 15:20, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> >> 
> >> > On Tue, Feb 18, 2025 at 08:29:46PM +0100, Jerome Brunet wrote:
> >> >> Add helper functions to create a device on the auxiliary bus.
> >> >> 
> >> >> This is meant for fairly simple usage of the auxiliary bus, to avoid having
> >> >> the same code repeated in the different drivers.
> >> >> 
> >> >> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> >> >> Cc: Arnd Bergmann <arnd@arndb.de>
> >> >> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> >> >
> >> > Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> 
> >> Hey Greg,
> >> 
> >> Do you need me to do something else on this topic ?
> >
> > I don't know what tree it is going through, do you?  If you want me to
> > take in the driver-core tree, just let me know.
> 
> For patch #1, I think driver-core would be appropriate, unless there is
> something more specific for the auxiliary device support ?
> 
> I'll wait for this sink into an rc1, then resubmit the different driver
> changes to the appropriate tree, no rush.

Ok, will take just the first one then, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device
  2025-02-25 16:04   ` Doug Anderson
@ 2025-06-09 13:02     ` Jerome Brunet
  2025-06-09 15:43       ` Doug Anderson
  0 siblings, 1 reply; 25+ messages in thread
From: Jerome Brunet @ 2025-06-09 13:02 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

On Tue 25 Feb 2025 at 08:04, Doug Anderson <dianders@chromium.org> wrote:

> Hi,
>
> On Tue, Feb 18, 2025 at 11:30 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
>>
>> The auxiliary device creation of this driver is simple enough to
>> use the available auxiliary device creation helper.
>>
>> Use it and remove some boilerplate code.
>>
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 49 +++++------------------------------
>>  1 file changed, 7 insertions(+), 42 deletions(-)
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
>
> I'll snooze this for a bunch of weeks and check back to see if this
> can be landed in drm-misc-next every once in a while. If you notice
> that drm-misc-next has the necessary patches before I do then feel
> free to poke me and I'll commit it.

Hi Doug,

FYI, this is safe to take with v6.16-rc1.
Please let know in case you prefer a resend.

>
> -Doug

-- 
Jerome

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device
  2025-06-09 13:02     ` Jerome Brunet
@ 2025-06-09 15:43       ` Doug Anderson
  2025-06-17  0:13         ` Doug Anderson
  0 siblings, 1 reply; 25+ messages in thread
From: Doug Anderson @ 2025-06-09 15:43 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

Hi,

On Mon, Jun 9, 2025 at 6:02 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
>
> On Tue 25 Feb 2025 at 08:04, Doug Anderson <dianders@chromium.org> wrote:
>
> > Hi,
> >
> > On Tue, Feb 18, 2025 at 11:30 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
> >>
> >> The auxiliary device creation of this driver is simple enough to
> >> use the available auxiliary device creation helper.
> >>
> >> Use it and remove some boilerplate code.
> >>
> >> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> >> ---
> >>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 49 +++++------------------------------
> >>  1 file changed, 7 insertions(+), 42 deletions(-)
> >
> > Reviewed-by: Douglas Anderson <dianders@chromium.org>
> >
> > I'll snooze this for a bunch of weeks and check back to see if this
> > can be landed in drm-misc-next every once in a while. If you notice
> > that drm-misc-next has the necessary patches before I do then feel
> > free to poke me and I'll commit it.
>
> Hi Doug,
>
> FYI, this is safe to take with v6.16-rc1.
> Please let know in case you prefer a resend.

Thanks for the reminder. Unfortunately, I still need to wait. This
patch will need to land through drm-misc-next and that doesn't have
v6.16-rc1 yet.

https://cgit.freedesktop.org/drm/drm-misc/

...presumably v6.16-rc1 will get merged in before too much longer.
I'll try to keep an eye on it.

-Doug

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device
  2025-06-09 15:43       ` Doug Anderson
@ 2025-06-17  0:13         ` Doug Anderson
  0 siblings, 0 replies; 25+ messages in thread
From: Doug Anderson @ 2025-06-17  0:13 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Greg Kroah-Hartman, Dave Ertman, Ira Weiny, Rafael J. Wysocki,
	Stephen Boyd, Arnd Bergmann, Danilo Krummrich, Conor Dooley,
	Daire McNamara, Philipp Zabel, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Hans de Goede, Ilpo Järvinen,
	Bryan O'Donoghue, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun, Michael Turquette, Abel Vesa, Peng Fan,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Kevin Hilman, Martin Blumenstingl, linux-kernel, linux-riscv,
	dri-devel, platform-driver-x86, linux-mips, linux-clk, imx,
	linux-arm-kernel, linux-amlogic

Hi,

On Mon, Jun 9, 2025 at 8:43 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Mon, Jun 9, 2025 at 6:02 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
> >
> > On Tue 25 Feb 2025 at 08:04, Doug Anderson <dianders@chromium.org> wrote:
> >
> > > Hi,
> > >
> > > On Tue, Feb 18, 2025 at 11:30 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
> > >>
> > >> The auxiliary device creation of this driver is simple enough to
> > >> use the available auxiliary device creation helper.
> > >>
> > >> Use it and remove some boilerplate code.
> > >>
> > >> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > >> ---
> > >>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 49 +++++------------------------------
> > >>  1 file changed, 7 insertions(+), 42 deletions(-)
> > >
> > > Reviewed-by: Douglas Anderson <dianders@chromium.org>
> > >
> > > I'll snooze this for a bunch of weeks and check back to see if this
> > > can be landed in drm-misc-next every once in a while. If you notice
> > > that drm-misc-next has the necessary patches before I do then feel
> > > free to poke me and I'll commit it.
> >
> > Hi Doug,
> >
> > FYI, this is safe to take with v6.16-rc1.
> > Please let know in case you prefer a resend.
>
> Thanks for the reminder. Unfortunately, I still need to wait. This
> patch will need to land through drm-misc-next and that doesn't have
> v6.16-rc1 yet.
>
> https://cgit.freedesktop.org/drm/drm-misc/
>
> ...presumably v6.16-rc1 will get merged in before too much longer.
> I'll try to keep an eye on it.

Pushed to drm-misc-next:

[3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device
      commit: 6526b02e10209608464f2645af59b2cc955b5a19

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2025-06-17  0:14 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18 19:29 [PATCH v4 0/8] driver core: auxiliary bus: add device creation helper Jerome Brunet
2025-02-18 19:29 ` [PATCH v4 1/8] driver core: auxiliary bus: add device creation helpers Jerome Brunet
2025-02-19  9:06   ` Dmitry Baryshkov
2025-02-19 10:13     ` Greg Kroah-Hartman
2025-02-19 12:08       ` Dmitry Baryshkov
2025-02-19 13:19         ` Greg Kroah-Hartman
2025-02-19 14:20   ` Greg Kroah-Hartman
2025-04-15 12:52     ` Jerome Brunet
2025-04-15 12:59       ` Greg Kroah-Hartman
2025-04-15 13:10         ` Jerome Brunet
2025-04-15 13:22           ` Greg Kroah-Hartman
2025-02-20 19:14   ` Ira Weiny
2025-02-18 19:29 ` [PATCH v4 2/8] reset: mpfs: use the auxiliary device creation Jerome Brunet
2025-02-19  9:16   ` Philipp Zabel
2025-02-18 19:29 ` [PATCH v4 3/8] drm/bridge: ti-sn65dsi86: use the auxiliary device Jerome Brunet
2025-02-25 16:04   ` Doug Anderson
2025-06-09 13:02     ` Jerome Brunet
2025-06-09 15:43       ` Doug Anderson
2025-06-17  0:13         ` Doug Anderson
2025-02-18 19:29 ` [PATCH v4 4/8] platform: arm64: lenovo-yoga-c630: use the auxiliary device creation helper Jerome Brunet
2025-02-18 19:29 ` [PATCH v4 5/8] clk: eyeq: " Jerome Brunet
2025-02-18 19:29 ` [PATCH v4 6/8] reset: eyeq: drop device_set_of_node_from_dev() done by parent Jerome Brunet
2025-02-19  9:16   ` Philipp Zabel
2025-02-18 19:29 ` [PATCH v4 7/8] clk: clk-imx8mp-audiomix: use the auxiliary device creation helper Jerome Brunet
2025-02-18 19:29 ` [PATCH v4 8/8] clk: amlogic: axg-audio: use the auxiliary reset driver - take 2 Jerome Brunet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).