summaryrefslogtreecommitdiff
path: root/drivers/amba/bus.c
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2011-10-05 14:44:57 +0100
committerDave Martin <dave.martin@linaro.org>2011-11-22 10:58:30 +0000
commit523817bd22617cd62199ae4ca2a6f5e1aa250654 (patch)
treecf3d5597fb8be2e8d7da4d76a8824e5267f14c40 /drivers/amba/bus.c
parent1e5f9a23430e64fb56d9d5d8e1ca165ba1cfeb75 (diff)
ARM: amba: Auto-generate AMBA driver module aliases during modpost
This patch adds the necessary support in file2alias.c to define suitable aliases based on the amba_id table in AMBA driver modules. This should be sufficient to allow such modules to be auto-loaded via udev. The AMBA bus driver's uevent hotplug code is also modified to pass an approriate MODALIAS string in the event. For simplicity, the AMBA ID is treated an an opaque 32-bit numeber. Module alises use patterns as appropriate to describe the value- mask pairs described in the driver's amba_id list. The proposed alias format is (extended regex): ^amba:d(HEX){8}$ Where HEX is a single upper-case HEX digit or a pattern (? or [] expression) matching a single upper-case HEX digit, as expected by udev. "d" is short for "device", following existing alias naming conventions for other device types. This adds some flexibility for unambiguously extending the alias format in the future by adding additional leading and trailing fields, if this turns out to be necessary. Signed-off-by: Dave Martin <dave.martin@linaro.org> Acked-by: Pawel Moll <pawel.moll@arm.com>
Diffstat (limited to 'drivers/amba/bus.c')
-rw-r--r--drivers/amba/bus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index bd230e801131..936c98cb2475 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -52,6 +52,10 @@ 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);
+ if (retval)
+ return retval;
+
+ retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid);
return retval;
}
#else