@@ -472,8 +472,8 @@ static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base)
472
472
* specifies that S0ReadyInt and S1ReadyInt should be '1'.
473
473
*/
474
474
sa1111_writel (0 , irqbase + SA1111_INTPOL0 );
475
- sa1111_writel (SA1111_IRQMASK_HI (IRQ_S0_READY_NINT ) |
476
- SA1111_IRQMASK_HI (IRQ_S1_READY_NINT ),
475
+ sa1111_writel (BIT (IRQ_S0_READY_NINT & 31 ) |
476
+ BIT (IRQ_S1_READY_NINT & 31 ),
477
477
irqbase + SA1111_INTPOL1 );
478
478
479
479
/* clear all IRQs */
@@ -754,7 +754,7 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
754
754
if (sachip -> irq != NO_IRQ ) {
755
755
ret = sa1111_setup_irq (sachip , pd -> irq_base );
756
756
if (ret )
757
- goto err_unmap ;
757
+ goto err_clk ;
758
758
}
759
759
760
760
#ifdef CONFIG_ARCH_SA1100
@@ -799,6 +799,8 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
799
799
800
800
return 0 ;
801
801
802
+ err_clk :
803
+ clk_disable (sachip -> clk );
802
804
err_unmap :
803
805
iounmap (sachip -> base );
804
806
err_clk_unprep :
@@ -869,9 +871,9 @@ struct sa1111_save_data {
869
871
870
872
#ifdef CONFIG_PM
871
873
872
- static int sa1111_suspend (struct platform_device * dev , pm_message_t state )
874
+ static int sa1111_suspend_noirq (struct device * dev )
873
875
{
874
- struct sa1111 * sachip = platform_get_drvdata (dev );
876
+ struct sa1111 * sachip = dev_get_drvdata (dev );
875
877
struct sa1111_save_data * save ;
876
878
unsigned long flags ;
877
879
unsigned int val ;
@@ -934,9 +936,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
934
936
* restored by their respective drivers, and must be called
935
937
* via LDM after this function.
936
938
*/
937
- static int sa1111_resume (struct platform_device * dev )
939
+ static int sa1111_resume_noirq (struct device * dev )
938
940
{
939
- struct sa1111 * sachip = platform_get_drvdata (dev );
941
+ struct sa1111 * sachip = dev_get_drvdata (dev );
940
942
struct sa1111_save_data * save ;
941
943
unsigned long flags , id ;
942
944
void __iomem * base ;
@@ -952,7 +954,7 @@ static int sa1111_resume(struct platform_device *dev)
952
954
id = sa1111_readl (sachip -> base + SA1111_SKID );
953
955
if ((id & SKID_ID_MASK ) != SKID_SA1111_ID ) {
954
956
__sa1111_remove (sachip );
955
- platform_set_drvdata (dev , NULL );
957
+ dev_set_drvdata (dev , NULL );
956
958
kfree (save );
957
959
return 0 ;
958
960
}
@@ -1003,8 +1005,8 @@ static int sa1111_resume(struct platform_device *dev)
1003
1005
}
1004
1006
1005
1007
#else
1006
- #define sa1111_suspend NULL
1007
- #define sa1111_resume NULL
1008
+ #define sa1111_suspend_noirq NULL
1009
+ #define sa1111_resume_noirq NULL
1008
1010
#endif
1009
1011
1010
1012
static int sa1111_probe (struct platform_device * pdev )
@@ -1017,7 +1019,7 @@ static int sa1111_probe(struct platform_device *pdev)
1017
1019
return - EINVAL ;
1018
1020
irq = platform_get_irq (pdev , 0 );
1019
1021
if (irq < 0 )
1020
- return - ENXIO ;
1022
+ return irq ;
1021
1023
1022
1024
return __sa1111_probe (& pdev -> dev , mem , irq );
1023
1025
}
@@ -1038,6 +1040,11 @@ static int sa1111_remove(struct platform_device *pdev)
1038
1040
return 0 ;
1039
1041
}
1040
1042
1043
+ static struct dev_pm_ops sa1111_pm_ops = {
1044
+ .suspend_noirq = sa1111_suspend_noirq ,
1045
+ .resume_noirq = sa1111_resume_noirq ,
1046
+ };
1047
+
1041
1048
/*
1042
1049
* Not sure if this should be on the system bus or not yet.
1043
1050
* We really want some way to register a system device at
@@ -1050,10 +1057,9 @@ static int sa1111_remove(struct platform_device *pdev)
1050
1057
static struct platform_driver sa1111_device_driver = {
1051
1058
.probe = sa1111_probe ,
1052
1059
.remove = sa1111_remove ,
1053
- .suspend = sa1111_suspend ,
1054
- .resume = sa1111_resume ,
1055
1060
.driver = {
1056
1061
.name = "sa1111" ,
1062
+ .pm = & sa1111_pm_ops ,
1057
1063
},
1058
1064
};
1059
1065
0 commit comments