[RFC PATCH 1/3] ARM: amba: pass a suitable modalias to udev

Dave Martin dave.martin at linaro.org
Fri Sep 30 12:56:40 EDT 2011

This patch defines and imlpements a new modalias for AMBA devices:


where 'x' is a hex digit in lower case.

This enables udev to auto-load modules transparently for AMBA
devices, provided that each driver makes suitable MODULE_ALIAS()
declarations based on the supported AMBA device IDs.

Without this, drivers built as modules never get loaded, unless
they are loaded manually.

Signed-off-by: Dave Martin <dave.martin at linaro.org>
 drivers/amba/bus.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index d74926e..7d2ba0b 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -52,7 +52,14 @@ static int amba_uevent(struct device *dev, struct kobj_uevent_env *env)
 	int retval = 0;
 	retval = add_uevent_var(env, "AMBA_ID=%08x", pcdev->periphid);
-	return retval;
+	if (retval)
+		return retval;
+	retval = add_uevent_var(env, "MODALIAS=amba:%08x", pcdev->periphid);
+	if (retval)
+		return retval;
+	return 0;
 #define amba_uevent NULL

More information about the linux-arm-kernel mailing list