Skip to content

Commit f2d6677

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/ipmmu-vmsa: Minor cleanups
Remove the of_match_ptr() which was supposed to have gone long ago, but managed to got lost in a fix-squashing mishap. On a similar theme, we may as well also modernise the PM ops to get rid of the clunky #ifdefs, and modernise the resource mapping to keep the checkpatch brigade happy. Link: https://lore.kernel.org/linux-iommu/[email protected]/ Signed-off-by: Robin Murphy <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Link: https://lore.kernel.org/r/791877b0d310dc2ab7dc616d2786ab24252b9b8e.1707151207.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent 54be6c6 commit f2d6677

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

drivers/iommu/ipmmu-vmsa.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,6 @@ static const struct of_device_id ipmmu_of_ids[] = {
10051005
static int ipmmu_probe(struct platform_device *pdev)
10061006
{
10071007
struct ipmmu_vmsa_device *mmu;
1008-
struct resource *res;
10091008
int irq;
10101009
int ret;
10111010

@@ -1025,8 +1024,7 @@ static int ipmmu_probe(struct platform_device *pdev)
10251024
return ret;
10261025

10271026
/* 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);
10301028
if (IS_ERR(mmu->base))
10311029
return PTR_ERR(mmu->base);
10321030

@@ -1123,7 +1121,6 @@ static void ipmmu_remove(struct platform_device *pdev)
11231121
ipmmu_device_reset(mmu);
11241122
}
11251123

1126-
#ifdef CONFIG_PM_SLEEP
11271124
static int ipmmu_resume_noirq(struct device *dev)
11281125
{
11291126
struct ipmmu_vmsa_device *mmu = dev_get_drvdata(dev);
@@ -1153,18 +1150,14 @@ static int ipmmu_resume_noirq(struct device *dev)
11531150
}
11541151

11551152
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)
11571154
};
1158-
#define DEV_PM_OPS &ipmmu_pm
1159-
#else
1160-
#define DEV_PM_OPS NULL
1161-
#endif /* CONFIG_PM_SLEEP */
11621155

11631156
static struct platform_driver ipmmu_driver = {
11641157
.driver = {
11651158
.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),
11681161
},
11691162
.probe = ipmmu_probe,
11701163
.remove_new = ipmmu_remove,

0 commit comments

Comments
 (0)