[PATCH 1/5 resend] pxa: Fix warning in zeus.c
Subsystems:
arm port , pxa2xx/pxa3xx support , the rest
STALE5719d
12 messages,
3 authors,
2011-01-12 · open the first message on its own page
Signed-off-by: Marek Vasut <redacted>
---
arch/arm/mach-pxa/zeus.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index c87f2b3..29830a3 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c @@ -830,8 +830,8 @@ static void __init zeus_init(void)
pr_info ( "Zeus CPLD V%dI%d \n " , ( system_rev & 0xf0 ) >> 4 , ( system_rev & 0x0f ));
/* Fix timings for dm9000s (CS1/CS2)*/
- msc0 = __raw_readl ( MSC0 ) & 0x0000ffff | ( dm9000_msc << 16 );
- msc1 = __raw_readl ( MSC1 ) & 0xffff0000 | dm9000_msc ;
+ msc0 = ( __raw_readl ( MSC0 ) & 0x0000ffff ) | ( dm9000_msc << 16 );
+ msc1 = ( __raw_readl ( MSC1 ) & 0xffff0000 ) | dm9000_msc ;
__raw_writel ( msc0 , MSC0 );
__raw_writel ( msc1 , MSC1 );
--
1.7.2.3
Signed-off-by: Marek Vasut <redacted>
---
arch/arm/mach-pxa/clock-pxa3xx.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c
index 1b08a34..3f864cd 100644
--- a/arch/arm/mach-pxa/clock-pxa3xx.c
+++ b/arch/arm/mach-pxa/clock-pxa3xx.c @@ -115,7 +115,6 @@ static unsigned long clk_pxa3xx_smemc_getrate(struct clk *clk)
{
unsigned long acsr = ACSR ;
unsigned long memclkcfg = __raw_readl ( MEMCLKCFG );
- unsigned int smcfs = ( acsr >> 23 ) & 0x7 ;
return BASE_CLK * smcfs_mult [( acsr >> 23 ) & 0x7 ] /
df_clkdiv [( memclkcfg >> 16 ) & 0x3 ]; --
1.7.2.3
Signed-off-by: Marek Vasut <redacted>
---
arch/arm/mach-pxa/irq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 54e91c9..78f0e0c 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -226,7 +226,7 @@ static int pxa_irq_resume(struct sys_device *dev)
__raw_writel ( 0 , base + ICLR );
}
- if ( ! cpu_is_pxa25x ())
+ if ( cpu_has_ipr ())
for ( i = 0 ; i < pxa_internal_irq_nr ; i ++ )
__raw_writel ( saved_ipr [ i ], IRQ_BASE + IPR ( i ));
--
1.7.2.3
Signed-off-by: Marek Vasut <redacted>
---
v2: Fix loop condition as proposed by Sergei
arch/arm/mach-pxa/irq.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 78f0e0c..a7deff5 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -156,7 +156,7 @@ static inline void __iomem *irq_base(int i)
0x40d00130 ,
};
- return ( void __iomem * ) io_p2v ( phys_base [ i >> 5 ]);
+ return ( void __iomem * ) io_p2v ( phys_base [ i ]);
}
void __init pxa_init_irq ( int irq_nr , set_wake_t fn ) @@ -168,7 +168,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
pxa_internal_irq_nr = irq_nr ;
for ( n = 0 ; n < irq_nr ; n += 32 ) {
- void __iomem * base = irq_base ( n );
+ void __iomem * base = irq_base ( n >> 5 );
__raw_writel ( 0 , base + ICMR ); /* disable all IRQs */
__raw_writel ( 0 , base + ICLR ); /* all IRQs are IRQ, not FIQ */ @@ -200,7 +200,7 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
{
int i ;
- for ( i = 0 ; i < pxa_internal_irq_nr ; i += 32 ) {
+ for ( i = 0 ; i < pxa_internal_irq_nr / 32 ; i ++ ) {
void __iomem * base = irq_base ( i );
saved_icmr [ i ] = __raw_readl ( base + ICMR ); @@ -219,7 +219,7 @@ static int pxa_irq_resume(struct sys_device *dev)
{
int i ;
- for ( i = 0 ; i < pxa_internal_irq_nr ; i += 32 ) {
+ for ( i = 0 ; i < pxa_internal_irq_nr / 32 ; i ++ ) {
void __iomem * base = irq_base ( i );
__raw_writel ( saved_icmr [ i ], base + ICMR ); --
1.7.2.3
Signed-off-by: Marek Vasut <redacted>
---
v2: Remove dead code as proposed by Sergei
arch/arm/mach-pxa/irq.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index a7deff5..76e69cf 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
static void pxa_mask_low_gpio ( unsigned int irq )
{
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> mask ( irq );
+ pxa_mask_irq ( irq );
}
static void pxa_unmask_low_gpio ( unsigned int irq )
{
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> unmask ( irq );
+ pxa_unmask_irq ( irq );
}
static struct irq_chip pxa_low_gpio_chip = { --
1.7.2.3
On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut [off-list ref] wrote: quoted hunk Signed-off-by: Marek Vasut <redacted>
---
v2: Fix loop condition as proposed by Sergei
?arch/arm/mach-pxa/irq.c | ? ?8 ++++----
?1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 78f0e0c..a7deff5 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -156,7 +156,7 @@ static inline void __iomem *irq_base(int i) ? ? ? ? ? ? ? ?0x40d00130,
? ? ? ?};
- ? ? ? return (void __iomem *)io_p2v(phys_base[i >> 5]);
+ ? ? ? return (void __iomem *)io_p2v(phys_base[i]);
?}
?void __init pxa_init_irq(int irq_nr, set_wake_t fn) @@ -168,7 +168,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn) ? ? ? ?pxa_internal_irq_nr = irq_nr;
? ? ? ?for (n = 0; n < irq_nr; n += 32) {
- ? ? ? ? ? ? ? void __iomem *base = irq_base(n);
+ ? ? ? ? ? ? ? void __iomem *base = irq_base(n >> 5);
? ? ? ? ? ? ? ?__raw_writel(0, base + ICMR); ? /* disable all IRQs */
? ? ? ? ? ? ? ?__raw_writel(0, base + ICLR); ? /* all IRQs are IRQ, not FIQ */ @@ -200,7 +200,7 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) ?{
? ? ? ?int i;
- ? ? ? for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
? ? ? ? ? ? ? ?void __iomem *base = irq_base(i);
I prefer it to be IRQ number based instead of IRQ bank based,
in other word, I'd rather to change the statement below:
? ? ? ? ? ? ? ?saved_icmr[i] = __raw_readl(base + ICMR);
to something:
saved_icmr[i / 32] = __raw_read(base + ICMR);
quoted hunk @@ -219,7 +219,7 @@ static int pxa_irq_resume(struct sys_device *dev) ?{
? ? ? ?int i;
- ? ? ? for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
? ? ? ? ? ? ? ?void __iomem *base = irq_base(i);
? ? ? ? ? ? ? ?__raw_writel(saved_icmr[i], base + ICMR);
--
1.7.2.3
On Tuesday 11 January 2011 00:41:26 Eric Miao wrote: On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut [off-list ref] wrote: quoted Signed-off-by: Marek Vasut <redacted>
---
v2: Fix loop condition as proposed by Sergei
arch/arm/mach-pxa/irq.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 78f0e0c..a7deff5 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -156,7 +156,7 @@ static inline void __iomem *irq_base(int i)
0x40d00130 ,
};
- return ( void __iomem * ) io_p2v ( phys_base [ i >> 5 ]);
+ return ( void __iomem * ) io_p2v ( phys_base [ i ]);
}
void __init pxa_init_irq ( int irq_nr , set_wake_t fn ) @@ -168,7 +168,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
pxa_internal_irq_nr = irq_nr ;
for ( n = 0 ; n < irq_nr ; n += 32 ) {
- void __iomem * base = irq_base ( n );
+ void __iomem * base = irq_base ( n >> 5 );
__raw_writel ( 0 , base + ICMR ); /* disable all IRQs */
__raw_writel ( 0 , base + ICLR ); /* all IRQs are IRQ, not FIQ */ @@ -200,7 +200,7 @@ static int pxa_irq_suspend(struct sys_device
*dev, pm_message_t state) {
int i;
- for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
void __iomem *base = irq_base(i);
I prefer it to be IRQ number based instead of IRQ bank based,
in other word, I'd rather to change the statement below: quoted saved_icmr[i] = __raw_readl(base + ICMR);
to something:
saved_icmr[i / 32] = __raw_read(base + ICMR);
Exactly what I wanted to avoid ... won't you be doing a division "# of bank"-
times instead of once there ?
quoted @@ -219,7 +219,7 @@ static int pxa_irq_resume(struct sys_device *dev)
{
int i;
- for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
void __iomem *base = irq_base(i);
__raw_writel(saved_icmr[i], base + ICMR);
- -1.7.2.3
On Mon, Jan 10, 2011 at 5:46 PM, Marek Vasut [off-list ref] wrote: On Tuesday 11 January 2011 00:41:26 Eric Miao wrote: quoted On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut [off-list ref] wrote: quoted Signed-off-by: Marek Vasut <redacted>
---
v2: Fix loop condition as proposed by Sergei
?arch/arm/mach-pxa/irq.c | ? ?8 ++++----
?1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 78f0e0c..a7deff5 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -156,7 +156,7 @@ static inline void __iomem *irq_base(int i) ? ? ? ? ? ? ? ?0x40d00130,
? ? ? ?};
- ? ? ? return (void __iomem *)io_p2v(phys_base[i >> 5]);
+ ? ? ? return (void __iomem *)io_p2v(phys_base[i]);
?}
?void __init pxa_init_irq(int irq_nr, set_wake_t fn) @@ -168,7 +168,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn) ? ? ? ?pxa_internal_irq_nr = irq_nr;
? ? ? ?for (n = 0; n < irq_nr; n += 32) {
- ? ? ? ? ? ? ? void __iomem *base = irq_base(n);
+ ? ? ? ? ? ? ? void __iomem *base = irq_base(n >> 5);
? ? ? ? ? ? ? ?__raw_writel(0, base + ICMR); ? /* disable all IRQs */
? ? ? ? ? ? ? ?__raw_writel(0, base + ICLR); ? /* all IRQs are IRQ, not
FIQ */ @@ -200,7 +200,7 @@ static int pxa_irq_suspend(struct sys_device
*dev, pm_message_t state) {
? ? ? ?int i;
- ? ? ? for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
? ? ? ? ? ? ? ?void __iomem *base = irq_base(i);
I prefer it to be IRQ number based instead of IRQ bank based,
in other word, I'd rather to change the statement below: quoted ? ? ? ? ? ? ? ?saved_icmr[i] = __raw_readl(base + ICMR);
to something:
saved_icmr[i / 32] = __raw_read(base + ICMR);
Exactly what I wanted to avoid ... won't you be doing a division "# of bank"-
times instead of once there ?
I'm fine with either way. Applied.
quoted quoted @@ -219,7 +219,7 @@ static int pxa_irq_resume(struct sys_device *dev) ?{
? ? ? ?int i;
- ? ? ? for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
? ? ? ? ? ? ? ?void __iomem *base = irq_base(i);
? ? ? ? ? ? ? ?__raw_writel(saved_icmr[i], base + ICMR);
--
1.7.2.3
The original intention is to re-use pxa_{mask,unmask}_irq(), will
the change below looks better? The move of irq_base() is to avoid
the error of function not declared.
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index a7deff5..6107253 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -53,6 +53,17 @@ static inline int cpu_has_ipr(void)
return ! cpu_is_pxa25x ();
}
+ static inline void __iomem * irq_base ( int i )
+ {
+ static unsigned long phys_base [] = {
+ 0x40d00000 ,
+ 0x40d0009c ,
+ 0x40d00130 ,
+ };
+
+ return ( void __iomem * ) io_p2v ( phys_base [ i ]);
+ }
+
static void pxa_mask_irq ( unsigned int irq )
{
void __iomem * base = get_irq_chip_data ( irq ); @@ -108,25 +119,11 @@ static void pxa_ack_low_gpio(unsigned int irq)
GEDR0 = ( 1 << ( irq - IRQ_GPIO0 ));
}
- static void pxa_mask_low_gpio ( unsigned int irq )
- {
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> mask ( irq );
- }
-
- static void pxa_unmask_low_gpio ( unsigned int irq )
- {
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> unmask ( irq );
- }
-
static struct irq_chip pxa_low_gpio_chip = {
. name = "GPIO-l" ,
. ack = pxa_ack_low_gpio ,
- . mask = pxa_mask_low_gpio ,
- . unmask = pxa_unmask_low_gpio ,
+ . mask = pxa_mask_irq ,
+ . unmask = pxa_unmask_irq ,
. set_type = pxa_set_low_gpio_type ,
};
@@ -141,6 +138,7 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
for ( irq = IRQ_GPIO0 ; irq <= IRQ_GPIO1 ; irq ++ ) {
set_irq_chip ( irq , & pxa_low_gpio_chip );
+ set_irq_chip_data ( irq , irq_base ( 0 ));
set_irq_handler ( irq , handle_edge_irq );
set_irq_flags ( irq , IRQF_VALID );
} @@ -148,17 +146,6 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
pxa_low_gpio_chip . set_wake = fn ;
}
- static inline void __iomem * irq_base ( int i )
- {
- static unsigned long phys_base [] = {
- 0x40d00000 ,
- 0x40d0009c ,
- 0x40d00130 ,
- };
-
- return ( void __iomem * ) io_p2v ( phys_base [ i ]);
- }
-
void __init pxa_init_irq ( int irq_nr , set_wake_t fn )
{
int irq , i , n ;
On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut [off-list ref] wrote: quoted hunk Signed-off-by: Marek Vasut <redacted>
---
v2: Remove dead code as proposed by Sergei
?arch/arm/mach-pxa/irq.c | ? ?8 ++------
?1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index a7deff5..76e69cf 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
?static void pxa_mask_low_gpio(unsigned int irq)
?{
- ? ? ? struct irq_desc *desc = irq_to_desc(irq);
-
- ? ? ? desc->chip->mask(irq);
+ ? ? ? pxa_mask_irq(irq);
?}
?static void pxa_unmask_low_gpio(unsigned int irq)
?{
- ? ? ? struct irq_desc *desc = irq_to_desc(irq);
-
- ? ? ? desc->chip->unmask(irq);
+ ? ? ? pxa_unmask_irq(irq);
?}
?static struct irq_chip pxa_low_gpio_chip = {
--
1.7.2.3
Hello.
On 11-01-2011 1:53, Marek Vasut wrote:
Signed-off-by: Marek Vasut<redacted>
---
v2: Remove dead code as proposed by Sergei arch/arm/mach-pxa/irq.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-) quoted hunk diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index a7deff5..76e69cf 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
static void pxa_mask_low_gpio ( unsigned int irq )
{
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> mask ( irq );
+ pxa_mask_irq ( irq );
}
static void pxa_unmask_low_gpio ( unsigned int irq )
{
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> unmask ( irq );
+ pxa_unmask_irq ( irq );
}
static struct irq_chip pxa_low_gpio_chip = {
If the above two functions are the methods of this IRQ chip, shouldn't you
just replace the initializers and remove the functions altogether?
WBR, Sergei
On Wednesday 12 January 2011 00:16:50 Eric Miao wrote: quoted hunk The original intention is to re-use pxa_{mask,unmask}_irq(), will
the change below looks better? The move of irq_base() is to avoid
the error of function not declared.
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index a7deff5..6107253 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -53,6 +53,17 @@ static inline int cpu_has_ipr(void)
return ! cpu_is_pxa25x ();
}
+ static inline void __iomem * irq_base ( int i )
+ {
+ static unsigned long phys_base [] = {
+ 0x40d00000 ,
+ 0x40d0009c ,
+ 0x40d00130 ,
+ };
+
+ return ( void __iomem * ) io_p2v ( phys_base [ i ]);
+ }
+
static void pxa_mask_irq ( unsigned int irq )
{
void __iomem * base = get_irq_chip_data ( irq ); @@ -108,25 +119,11 @@ static void pxa_ack_low_gpio(unsigned int irq)
GEDR0 = ( 1 << ( irq - IRQ_GPIO0 ));
}
- static void pxa_mask_low_gpio ( unsigned int irq )
- {
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> mask ( irq );
- }
-
- static void pxa_unmask_low_gpio ( unsigned int irq )
- {
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> unmask ( irq );
- }
-
static struct irq_chip pxa_low_gpio_chip = {
. name = "GPIO-l" ,
. ack = pxa_ack_low_gpio ,
- . mask = pxa_mask_low_gpio ,
- . unmask = pxa_unmask_low_gpio ,
+ . mask = pxa_mask_irq ,
+ . unmask = pxa_unmask_irq ,
. set_type = pxa_set_low_gpio_type ,
};
@@ -141,6 +138,7 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
for ( irq = IRQ_GPIO0 ; irq <= IRQ_GPIO1 ; irq ++ ) {
set_irq_chip ( irq , & pxa_low_gpio_chip );
+ set_irq_chip_data ( irq , irq_base ( 0 ));
set_irq_handler ( irq , handle_edge_irq );
set_irq_flags ( irq , IRQF_VALID );
} @@ -148,17 +146,6 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn) pxa_low_gpio_chip.set_wake = fn;
}
-static inline void __iomem *irq_base(int i)
-{
- static unsigned long phys_base[] = {
- 0x40d00000,
- 0x40d0009c,
- 0x40d00130,
- };
-
- return (void __iomem *)io_p2v(phys_base[i]);
-}
-
void __init pxa_init_irq(int irq_nr, set_wake_t fn)
{
int irq, i, n;
Way better indeed
Acked-by: Marek Vasut <redacted>
On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut [off-list ref] wrote: quoted Signed-off-by: Marek Vasut <redacted>
---
v2: Remove dead code as proposed by Sergei
arch/arm/mach-pxa/irq.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index a7deff5..76e69cf 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
static void pxa_mask_low_gpio ( unsigned int irq )
{
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> mask ( irq );
+ pxa_mask_irq ( irq );
}
static void pxa_unmask_low_gpio ( unsigned int irq )
{
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> unmask ( irq );
+ pxa_unmask_irq ( irq );
}
static struct irq_chip pxa_low_gpio_chip = {
- - 1.7.2.3
On Wednesday 12 January 2011 00:16:50 Eric Miao wrote: The original intention is to re-use pxa_{mask,unmask}_irq(), will
the change below looks better? The move of irq_base() is to avoid
the error of function not declared.
Here's your :
Tested-by: Marek Vasut <redacted>
Tested on Zipit Z2 quoted hunk diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index a7deff5..6107253 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -53,6 +53,17 @@ static inline int cpu_has_ipr(void)
return ! cpu_is_pxa25x ();
}
+ static inline void __iomem * irq_base ( int i )
+ {
+ static unsigned long phys_base [] = {
+ 0x40d00000 ,
+ 0x40d0009c ,
+ 0x40d00130 ,
+ };
+
+ return ( void __iomem * ) io_p2v ( phys_base [ i ]);
+ }
+
static void pxa_mask_irq ( unsigned int irq )
{
void __iomem * base = get_irq_chip_data ( irq ); @@ -108,25 +119,11 @@ static void pxa_ack_low_gpio(unsigned int irq)
GEDR0 = ( 1 << ( irq - IRQ_GPIO0 ));
}
- static void pxa_mask_low_gpio ( unsigned int irq )
- {
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> mask ( irq );
- }
-
- static void pxa_unmask_low_gpio ( unsigned int irq )
- {
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> unmask ( irq );
- }
-
static struct irq_chip pxa_low_gpio_chip = {
. name = "GPIO-l" ,
. ack = pxa_ack_low_gpio ,
- . mask = pxa_mask_low_gpio ,
- . unmask = pxa_unmask_low_gpio ,
+ . mask = pxa_mask_irq ,
+ . unmask = pxa_unmask_irq ,
. set_type = pxa_set_low_gpio_type ,
};
@@ -141,6 +138,7 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
for ( irq = IRQ_GPIO0 ; irq <= IRQ_GPIO1 ; irq ++ ) {
set_irq_chip ( irq , & pxa_low_gpio_chip );
+ set_irq_chip_data ( irq , irq_base ( 0 ));
set_irq_handler ( irq , handle_edge_irq );
set_irq_flags ( irq , IRQF_VALID );
} @@ -148,17 +146,6 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn) pxa_low_gpio_chip.set_wake = fn;
}
-static inline void __iomem *irq_base(int i)
-{
- static unsigned long phys_base[] = {
- 0x40d00000,
- 0x40d0009c,
- 0x40d00130,
- };
-
- return (void __iomem *)io_p2v(phys_base[i]);
-}
-
void __init pxa_init_irq(int irq_nr, set_wake_t fn)
{
int irq, i, n;
On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut [off-list ref] wrote: quoted Signed-off-by: Marek Vasut <redacted>
---
v2: Remove dead code as proposed by Sergei
arch/arm/mach-pxa/irq.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index a7deff5..76e69cf 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c @@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
static void pxa_mask_low_gpio ( unsigned int irq )
{
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> mask ( irq );
+ pxa_mask_irq ( irq );
}
static void pxa_unmask_low_gpio ( unsigned int irq )
{
- struct irq_desc * desc = irq_to_desc ( irq );
-
- desc -> chip -> unmask ( irq );
+ pxa_unmask_irq ( irq );
}
static struct irq_chip pxa_low_gpio_chip = {
- - 1.7.2.3