Fixups to SystemACE driver
cover Fixups to SystemACE driver
Jens,
Here are some more Sysace patches based on comments received on the first series and a run through sparse. Can you please queue them up for 2.6.24?
Thanks,
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
PATCH 1/3 Sysace: Minor coding convention fixup
From: Grant Likely <[email protected]>
Put function call and return code test on separate lines.
---
drivers/block/xsysace.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/block/xsysace.c +6 -3
@@ -1091,7 +1091,8 @@ ace_alloc(struct device *dev, int id, unsigned long physaddr, ace->bus_width = bus_width;/* Call the setup code */ -if ((rc =ace_setup (ace)) !=0 ) + rc =ace_setup (ace); +if (rc) goto err_setup;dev_set_drvdata (dev, ace);
@@ -1253,11 +1254,13 @@ static int __init ace_init(void) goto err_blk; } -if ((rc =ace_of_register ()) !=0 ) + rc =ace_of_register (); +if (rc) goto err_of;pr_debug ("xsysace: registering platform binding\n" ); -if ((rc =platform_driver_register (&ace_platform_driver)) !=0 ) + rc =platform_driver_register (&ace_platform_driver); +if (rc) goto err_plat;pr_info ("Xilinx SystemACE device driver, major=%i\n" , ace_major);
PATCH 2/3 Sysace: sparse fixes
In reply to Grant LikelyFrom: Grant Likely <[email protected]>
---
drivers/block/xsysace.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/block/xsysace.c +5 -5
@@ -195,7 +195,7 @@ struct ace_device {/* Details of hardware device */ unsigned long physaddr; -void *baseaddr; +void __iomem *baseaddr;int irq;int bus_width;/* 0 := 8 bit; 1 := 16 bit */ struct ace_reg_ops *reg_ops;
@@ -227,20 +227,20 @@ struct ace_reg_ops {/* 8 Bit bus width */ static u16 ace_in_8 (struct ace_device *ace,int reg) { -void *r = ace->baseaddr + reg; +void __iomem *r = ace->baseaddr + reg;return in_8 (r) | (in_8 (r +1 ) <<8 ); }static void ace_out_8 (struct ace_device *ace,int reg,u16 val) { -void *r = ace->baseaddr + reg; +void __iomem *r = ace->baseaddr + reg;out_8 (r, val);out_8 (r +1 , val >>8 ); }static void ace_datain_8 (struct ace_device *ace) { -void *r = ace->baseaddr +0x40 ; +void __iomem *r = ace->baseaddr +0x40 ;u8 *dst = ace->data_ptr;int i =ACE_FIFO_SIZE ;while (i--)
@@ -250,7 +250,7 @@ static void ace_datain_8(struct ace_device *ace)static void ace_dataout_8 (struct ace_device *ace) { -void *r = ace->baseaddr +0x40 ; +void __iomem *r = ace->baseaddr +0x40 ;u8 *src = ace->data_ptr;int i =ACE_FIFO_SIZE ;while (i--)
PATCH 3/3 Sysace: Don't enable IRQ until after interrupt handler is registered
In reply to Grant LikelyFrom: Grant Likely <[email protected]>
The previous patch to move the interrupt handler registration moved it below enabling interrupts which could be a problem if the device is on a shared interrupt line. This patch fixes the order.
---
drivers/block/xsysace.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/block/xsysace.c +5 -5
@@ -1005,11 +1005,6 @@ static int __devinit ace_setup(struct ace_device *ace)ace_out (ace,ACE_CTRL ,ACE_CTRL_FORCECFGMODE |ACE_CTRL_DATABUFRDYIRQ |ACE_CTRL_ERRORIRQ ); -/* Enable interrupts */ - val =ace_in (ace,ACE_CTRL ); - val |=ACE_CTRL_DATABUFRDYIRQ |ACE_CTRL_ERRORIRQ ; -ace_out (ace,ACE_CTRL , val); -/* Now we can hook up the irq handler */ if (ace->irq !=NO_IRQ ) { rc =request_irq (ace->irq, ace_interrupt,0 ,"systemace" , ace);
@@ -1020,6 +1015,11 @@ static int __devinit ace_setup(struct ace_device *ace) } } +/* Enable interrupts */ + val =ace_in (ace,ACE_CTRL ); + val |=ACE_CTRL_DATABUFRDYIRQ |ACE_CTRL_ERRORIRQ ; +ace_out (ace,ACE_CTRL , val); +/* Print the identification */ dev_info (ace->dev,"Xilinx SystemACE revision %i.%i.%i\n" , (version >>12 ) &0xf , (version >>8 ) &0x0f , version &0xff );
Jens Axboe
AppliedQuoted 5 lines · Grant Likely
Jens,
Here are some more Sysace patches based on comments received on the first series and a run through sparse. Can you please queue them up for 2.6.24?
Applied all 3, looked fine to me.
Signature · 1 line
Jens Axboe