Skip to contentSkip to conversation

iommu: rockchip: fix build without CONFIG_OF

PATCH New Arnd Bergmann 4 participants 4 messages Apr 10, 2015 – May 5, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu: rockchip: fix build without CONFIG_OF

The rockchip iommu driver references its of_device_id table from the init function, which fails to build when the table is undefined:

iommu/rockchip-iommu.c: In function 'rk_iommu_init':
iommu/rockchip-iommu.c:1029:35: error: 'rk_iommu_dt_ids' undeclared (first use in this function)
np = of_find_matching_node(NULL, rk_iommu_dt_ids);

This removes the #ifdef and the corresponding of_match_ptr wrapper to make it build both with CONFIG_OF enabled or disabled.

Fixes 425061b0f5074 ("iommu/rockchip: Play nice in multi-platform builds")
drivers/iommu/rockchip-iommu.c +1 -3
index 4015560bf486..cab214544237 100644
@@ -1004,20 +1004,18 @@ static int rk_iommu_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id rk_iommu_dt_ids[] = {
 	{ .compatible = "rockchip,iommu" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rk_iommu_dt_ids);
-#endif
 
 static struct platform_driver rk_iommu_driver = {
 	.probe = rk_iommu_probe,
 	.remove = rk_iommu_remove,
 	.driver = {
 		   .name = "rk_iommu",
-		   .of_match_table = of_match_ptr(rk_iommu_dt_ids),
+		   .of_match_table = rk_iommu_dt_ids,
 	},
 };
 
#1 lore raw

PATCH 1/1 iommu: rockchip: fix build without CONFIG_OF

Quoted 8 lines · Arnd Bergmann

The rockchip iommu driver references its of_device_id table from the init function, which fails to build when the table is undefined:

iommu/rockchip-iommu.c: In function 'rk_iommu_init':
iommu/rockchip-iommu.c:1029:35: error: 'rk_iommu_dt_ids' undeclared (first use in this function)
np = of_find_matching_node(NULL, rk_iommu_dt_ids);

Quoted 5 lines

This removes the #ifdef and the corresponding of_match_ptr wrapper to make it build both with CONFIG_OF enabled or disabled.

Fixes 425061b0f5074 ("iommu/rockchip: Play nice in multi-platform builds")

How can this even happen? Rockchip depends on multiplatform, and multiplatform pulls in OF. Ah... COMPILE_TEST... oh well.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150413/14d922ea/attachment.sig>

maintainer
#2 lore raw

PATCH 1/1 iommu: rockchip: fix build without CONFIG_OF

In reply to Arnd Bergmann

Am Freitag, 10. April 2015, 23:58:24 schrieb Arnd Bergmann:

Quoted 8 lines

The rockchip iommu driver references its of_device_id table from the init function, which fails to build when the table is undefined:

iommu/rockchip-iommu.c: In function 'rk_iommu_init':
iommu/rockchip-iommu.c:1029:35: error: 'rk_iommu_dt_ids' undeclared (first use in this function) np = of_find_matching_node(NULL, rk_iommu_dt_ids);

Quoted 5 lines

This removes the #ifdef and the corresponding of_match_ptr wrapper to make it build both with CONFIG_OF enabled or disabled.

Fixes 425061b0f5074 ("iommu/rockchip: Play nice in multi-platform builds")

not sure if another one is needed, but nevertheless

Applied
#3 lore raw

PATCH 1/1 iommu: rockchip: fix build without CONFIG_OF

In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

The rockchip iommu driver references its of_device_id table from the init function, which fails to build when the table is undefined:

iommu/rockchip-iommu.c: In function 'rk_iommu_init':
iommu/rockchip-iommu.c:1029:35: error: 'rk_iommu_dt_ids' undeclared (first use in this function)
np = of_find_matching_node(NULL, rk_iommu_dt_ids);

Quoted 5 lines

This removes the #ifdef and the corresponding of_match_ptr wrapper to make it build both with CONFIG_OF enabled or disabled.

Fixes 425061b0f5074 ("iommu/rockchip: Play nice in multi-platform builds")

Applied to iommu/fixes, thanks.