@@ -1005,7 +1005,6 @@ static const struct of_device_id ipmmu_of_ids[] = {
1005
1005
static int ipmmu_probe (struct platform_device * pdev )
1006
1006
{
1007
1007
struct ipmmu_vmsa_device * mmu ;
1008
- struct resource * res ;
1009
1008
int irq ;
1010
1009
int ret ;
1011
1010
@@ -1025,8 +1024,7 @@ static int ipmmu_probe(struct platform_device *pdev)
1025
1024
return ret ;
1026
1025
1027
1026
/* Map I/O memory and request IRQ. */
1028
- res = platform_get_resource (pdev , IORESOURCE_MEM , 0 );
1029
- mmu -> base = devm_ioremap_resource (& pdev -> dev , res );
1027
+ mmu -> base = devm_platform_ioremap_resource (pdev , 0 );
1030
1028
if (IS_ERR (mmu -> base ))
1031
1029
return PTR_ERR (mmu -> base );
1032
1030
@@ -1123,7 +1121,6 @@ static void ipmmu_remove(struct platform_device *pdev)
1123
1121
ipmmu_device_reset (mmu );
1124
1122
}
1125
1123
1126
- #ifdef CONFIG_PM_SLEEP
1127
1124
static int ipmmu_resume_noirq (struct device * dev )
1128
1125
{
1129
1126
struct ipmmu_vmsa_device * mmu = dev_get_drvdata (dev );
@@ -1153,18 +1150,14 @@ static int ipmmu_resume_noirq(struct device *dev)
1153
1150
}
1154
1151
1155
1152
static const struct dev_pm_ops ipmmu_pm = {
1156
- SET_NOIRQ_SYSTEM_SLEEP_PM_OPS (NULL , ipmmu_resume_noirq )
1153
+ NOIRQ_SYSTEM_SLEEP_PM_OPS (NULL , ipmmu_resume_noirq )
1157
1154
};
1158
- #define DEV_PM_OPS &ipmmu_pm
1159
- #else
1160
- #define DEV_PM_OPS NULL
1161
- #endif /* CONFIG_PM_SLEEP */
1162
1155
1163
1156
static struct platform_driver ipmmu_driver = {
1164
1157
.driver = {
1165
1158
.name = "ipmmu-vmsa" ,
1166
- .of_match_table = of_match_ptr ( ipmmu_of_ids ) ,
1167
- .pm = DEV_PM_OPS ,
1159
+ .of_match_table = ipmmu_of_ids ,
1160
+ .pm = pm_sleep_ptr ( & ipmmu_pm ) ,
1168
1161
},
1169
1162
.probe = ipmmu_probe ,
1170
1163
.remove_new = ipmmu_remove ,
0 commit comments