From 9f2f0a9ea8e94be5b37e905c99815b6d889f537c Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 7 Sep 2010 22:43:19 +0100 Subject: [PATCH] --- yaml --- r: 212419 b: refs/heads/master c: 01723a9566f9e9ce4c75e5c4c9f6dc20600871a7 h: refs/heads/master i: 212417: a4a2a736f5a4bcbe8164256f1e832c756d70cce7 212415: 7d03401c31bb16a5544b4844dd68af1e5bb105c8 v: v3 --- [refs] | 2 +- trunk/drivers/amba/bus.c | 2 +- trunk/include/linux/amba/bus.h | 15 +++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index a29c11ee9614..e438027933a5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2da6d64a638eb982bebf34e2999f0b67cfb90f33 +refs/heads/master: 01723a9566f9e9ce4c75e5c4c9f6dc20600871a7 diff --git a/trunk/drivers/amba/bus.c b/trunk/drivers/amba/bus.c index d31590e7011b..2737b9752205 100644 --- a/trunk/drivers/amba/bus.c +++ b/trunk/drivers/amba/bus.c @@ -298,7 +298,7 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) amba_put_disable_pclk(dev); - if (cid == 0xb105f00d) + if (cid == AMBA_CID) dev->periphid = pid; if (!dev->periphid) diff --git a/trunk/include/linux/amba/bus.h b/trunk/include/linux/amba/bus.h index b0c174012436..c6454cca0447 100644 --- a/trunk/include/linux/amba/bus.h +++ b/trunk/include/linux/amba/bus.h @@ -20,6 +20,7 @@ #include #define AMBA_NR_IRQS 2 +#define AMBA_CID 0xb105f00d struct clk; @@ -70,9 +71,15 @@ void amba_release_regions(struct amba_device *); #define amba_pclk_disable(d) \ do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) -#define amba_config(d) (((d)->periphid >> 24) & 0xff) -#define amba_rev(d) (((d)->periphid >> 20) & 0x0f) -#define amba_manf(d) (((d)->periphid >> 12) & 0xff) -#define amba_part(d) ((d)->periphid & 0xfff) +/* Some drivers don't use the struct amba_device */ +#define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) +#define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) +#define AMBA_MANF_BITS(a) (((a) >> 12) & 0xff) +#define AMBA_PART_BITS(a) ((a) & 0xfff) + +#define amba_config(d) AMBA_CONFIG_BITS((d)->periphid) +#define amba_rev(d) AMBA_REV_BITS((d)->periphid) +#define amba_manf(d) AMBA_MANF_BITS((d)->periphid) +#define amba_part(d) AMBA_PART_BITS((d)->periphid) #endif