aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/amba/bus.c
diff options
context:
space:
mode:
authorEric Rannaud <eric.rannaud@gmail.com>2007-03-31 01:23:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 13:57:29 -0400
commitbf62456eb91f3d2ef0736081583d09b0b3c8b7ea (patch)
tree851c2559ae11835e19763b7c7c54393f0ae0d5f6 /drivers/amba/bus.c
parentbdc4960a0b4831a24276b65f1f7afdfc57f2f5cf (diff)
uevent: use add_uevent_var() instead of open coding it
Make use of add_uevent_var() instead of (often incorrectly) open coding it. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Eric Rannaud <eric.rannaud@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/amba/bus.c')
-rw-r--r--drivers/amba/bus.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index fd5475071acc..268e301775fc 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -47,14 +47,13 @@ static int amba_match(struct device *dev, struct device_driver *drv)
47static int amba_uevent(struct device *dev, char **envp, int nr_env, char *buf, int bufsz) 47static int amba_uevent(struct device *dev, char **envp, int nr_env, char *buf, int bufsz)
48{ 48{
49 struct amba_device *pcdev = to_amba_device(dev); 49 struct amba_device *pcdev = to_amba_device(dev);
50 int retval = 0, i = 0, len = 0;
50 51
51 if (nr_env < 2) 52 retval = add_uevent_var(envp, nr_env, &i,
52 return -ENOMEM; 53 buf, bufsz, &len,
53 54 "AMBA_ID=%08x", pcdev->periphid);
54 snprintf(buf, bufsz, "AMBA_ID=%08x", pcdev->periphid); 55 envp[i] = NULL;
55 *envp++ = buf; 56 return retval;
56 *envp++ = NULL;
57 return 0;
58} 57}
59#else 58#else
60#define amba_uevent NULL 59#define amba_uevent NULL