* [PATCH v2 3/3] iommu: convert DT component matching to component_match_add_release()
[not found] <20160603141548.GC1041@n2100.armlinux.org.uk>
@ 2016-06-03 14:21 ` Russell King
2016-06-03 15:20 ` Matthias Brugger
2016-06-15 13:31 ` Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Russell King @ 2016-06-03 14:21 UTC (permalink / raw)
To: devicetree, dri-devel, linux-arm-kernel, linux-arm-msm,
linux-mediatek, linux-rockchip
Cc: Joerg Roedel, Matthias Brugger, iommu
Convert DT component matching to use component_match_add_release().
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/iommu/mtk_iommu.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index c3043d8754e3..71cf62af4e24 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -24,6 +24,7 @@
#include <linux/iopoll.h>
#include <linux/list.h>
#include <linux/of_address.h>
+#include <linux/of_component.h>
#include <linux/of_iommu.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
@@ -552,11 +553,6 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data)
return 0;
}
-static int compare_of(struct device *dev, void *data)
-{
- return dev->of_node == data;
-}
-
static int mtk_iommu_bind(struct device *dev)
{
struct mtk_iommu_data *data = dev_get_drvdata(dev);
@@ -630,17 +626,19 @@ static int mtk_iommu_probe(struct platform_device *pdev)
continue;
plarbdev = of_find_device_by_node(larbnode);
- of_node_put(larbnode);
if (!plarbdev) {
plarbdev = of_platform_device_create(
larbnode, NULL,
platform_bus_type.dev_root);
- if (!plarbdev)
+ if (!plarbdev) {
+ of_node_put(larbnode);
return -EPROBE_DEFER;
+ }
}
data->smi_imu.larb_imu[i].dev = &plarbdev->dev;
- component_match_add(dev, &match, compare_of, larbnode);
+ component_match_add_of(dev, &match, larbnode);
+ of_node_put(larbnode);
}
platform_set_drvdata(pdev, data);
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 3/3] iommu: convert DT component matching to component_match_add_release()
2016-06-03 14:21 ` [PATCH v2 3/3] iommu: convert DT component matching to component_match_add_release() Russell King
@ 2016-06-03 15:20 ` Matthias Brugger
2016-06-15 13:31 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Matthias Brugger @ 2016-06-03 15:20 UTC (permalink / raw)
To: Russell King, devicetree, dri-devel, linux-arm-kernel,
linux-arm-msm, linux-mediatek, linux-rockchip
Cc: Joerg Roedel, iommu
On 03/06/16 16:21, Russell King wrote:
> Convert DT component matching to use component_match_add_release().
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/iommu/mtk_iommu.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> index c3043d8754e3..71cf62af4e24 100644
> --- a/drivers/iommu/mtk_iommu.c
> +++ b/drivers/iommu/mtk_iommu.c
> @@ -24,6 +24,7 @@
> #include <linux/iopoll.h>
> #include <linux/list.h>
> #include <linux/of_address.h>
> +#include <linux/of_component.h>
> #include <linux/of_iommu.h>
> #include <linux/of_irq.h>
> #include <linux/of_platform.h>
> @@ -552,11 +553,6 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data)
> return 0;
> }
>
> -static int compare_of(struct device *dev, void *data)
> -{
> - return dev->of_node == data;
> -}
> -
> static int mtk_iommu_bind(struct device *dev)
> {
> struct mtk_iommu_data *data = dev_get_drvdata(dev);
> @@ -630,17 +626,19 @@ static int mtk_iommu_probe(struct platform_device *pdev)
> continue;
>
> plarbdev = of_find_device_by_node(larbnode);
> - of_node_put(larbnode);
> if (!plarbdev) {
> plarbdev = of_platform_device_create(
> larbnode, NULL,
> platform_bus_type.dev_root);
> - if (!plarbdev)
> + if (!plarbdev) {
> + of_node_put(larbnode);
> return -EPROBE_DEFER;
> + }
> }
> data->smi_imu.larb_imu[i].dev = &plarbdev->dev;
>
> - component_match_add(dev, &match, compare_of, larbnode);
> + component_match_add_of(dev, &match, larbnode);
> + of_node_put(larbnode);
> }
>
> platform_set_drvdata(pdev, data);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 3/3] iommu: convert DT component matching to component_match_add_release()
2016-06-03 14:21 ` [PATCH v2 3/3] iommu: convert DT component matching to component_match_add_release() Russell King
2016-06-03 15:20 ` Matthias Brugger
@ 2016-06-15 13:31 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2016-06-15 13:31 UTC (permalink / raw)
To: Russell King
Cc: devicetree, dri-devel, linux-arm-kernel, linux-arm-msm,
linux-mediatek, linux-rockchip, Matthias Brugger, iommu
On Fri, Jun 03, 2016 at 03:21:30PM +0100, Russell King wrote:
> Convert DT component matching to use component_match_add_release().
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
> drivers/iommu/mtk_iommu.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-15 13:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20160603141548.GC1041@n2100.armlinux.org.uk>
2016-06-03 14:21 ` [PATCH v2 3/3] iommu: convert DT component matching to component_match_add_release() Russell King
2016-06-03 15:20 ` Matthias Brugger
2016-06-15 13:31 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).