* [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle
@ 2023-07-22 11:54 Krzysztof Kozlowski
2023-07-22 11:54 ` [PATCH 2/3] media: dt-bindings: samsung,fimc: correct unit addresses in DTS example Krzysztof Kozlowski
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-22 11:54 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Alim Akhtar, linux-media,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
Cc: Krzysztof Kozlowski
The FIMC IS camera must access the PMU (Power Management Unit) IO memory
to control camera power. This was achieved by duplicating the PMU node
as its child like:
soc@0 {
system-controller@10020000 { ... }; // Real PMU
camera@11800000 {
fimc-is@12000000 {
// FIMC IS camera node
pmu@10020000 {
reg = <0x10020000 0x3000>; // Fake PMU node
};
};
};
};
This is not a correct representation of the hardware. Mapping the PMU
(Power Management Unit) IO memory should be via syscon-like phandle
(samsung,pmu-syscon, already used for other drivers), not by duplicating
"pmu" Devicetree node inside the FIMC IS.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../media/samsung,exynos4212-fimc-is.yaml | 15 ++++++++++-----
.../devicetree/bindings/media/samsung,fimc.yaml | 5 +----
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/Documentation/devicetree/bindings/media/samsung,exynos4212-fimc-is.yaml b/Documentation/devicetree/bindings/media/samsung,exynos4212-fimc-is.yaml
index 3691cd4962b2..3a5ff3f47060 100644
--- a/Documentation/devicetree/bindings/media/samsung,exynos4212-fimc-is.yaml
+++ b/Documentation/devicetree/bindings/media/samsung,exynos4212-fimc-is.yaml
@@ -75,13 +75,20 @@ properties:
power-domains:
maxItems: 1
+ samsung,pmu-syscon:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ Power Management Unit (PMU) system controller interface, used to
+ power/start the ISP.
+
patternProperties:
"^pmu@[0-9a-f]+$":
type: object
additionalProperties: false
+ deprecated: true
description:
Node representing the SoC's Power Management Unit (duplicated with the
- correct PMU node in the SoC).
+ correct PMU node in the SoC). Deprecated, use samsung,pmu-syscon.
properties:
reg:
@@ -131,6 +138,7 @@ required:
- clock-names
- interrupts
- ranges
+ - samsung,pmu-syscon
- '#size-cells'
additionalProperties: false
@@ -179,15 +187,12 @@ examples:
<&sysmmu_fimc_fd>, <&sysmmu_fimc_mcuctl>;
iommu-names = "isp", "drc", "fd", "mcuctl";
power-domains = <&pd_isp>;
+ samsung,pmu-syscon = <&pmu_system_controller>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
- pmu@10020000 {
- reg = <0x10020000 0x3000>;
- };
-
i2c-isp@12140000 {
compatible = "samsung,exynos4212-i2c-isp";
reg = <0x12140000 0x100>;
diff --git a/Documentation/devicetree/bindings/media/samsung,fimc.yaml b/Documentation/devicetree/bindings/media/samsung,fimc.yaml
index 79ff6d83a9fd..530a08f5d3fe 100644
--- a/Documentation/devicetree/bindings/media/samsung,fimc.yaml
+++ b/Documentation/devicetree/bindings/media/samsung,fimc.yaml
@@ -236,15 +236,12 @@ examples:
<&sysmmu_fimc_fd>, <&sysmmu_fimc_mcuctl>;
iommu-names = "isp", "drc", "fd", "mcuctl";
power-domains = <&pd_isp>;
+ samsung,pmu-syscon = <&pmu_system_controller>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
- pmu@10020000 {
- reg = <0x10020000 0x3000>;
- };
-
i2c-isp@12140000 {
compatible = "samsung,exynos4212-i2c-isp";
reg = <0x12140000 0x100>;
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] media: dt-bindings: samsung,fimc: correct unit addresses in DTS example
2023-07-22 11:54 [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle Krzysztof Kozlowski
@ 2023-07-22 11:54 ` Krzysztof Kozlowski
2023-07-22 12:00 ` Conor Dooley
2023-07-22 11:54 ` [PATCH 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle Krzysztof Kozlowski
2023-07-24 16:24 ` [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: " Rob Herring
2 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-22 11:54 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Alim Akhtar, linux-media,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
Cc: Krzysztof Kozlowski
The camera node's ranges property and unit addresses of its children
were not correct. If camera is @11800000, then its fimc child is @0.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../bindings/media/samsung,fimc.yaml | 22 +++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/Documentation/devicetree/bindings/media/samsung,fimc.yaml b/Documentation/devicetree/bindings/media/samsung,fimc.yaml
index 530a08f5d3fe..88b176d594e2 100644
--- a/Documentation/devicetree/bindings/media/samsung,fimc.yaml
+++ b/Documentation/devicetree/bindings/media/samsung,fimc.yaml
@@ -117,7 +117,7 @@ examples:
#clock-cells = <1>;
#address-cells = <1>;
#size-cells = <1>;
- ranges = <0x0 0x0 0x18000000>;
+ ranges = <0x0 0x0 0xba1000>;
clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>,
<&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>;
@@ -132,9 +132,9 @@ examples:
pinctrl-0 = <&cam_port_a_clk_active &cam_port_b_clk_active>;
pinctrl-names = "default";
- fimc@11800000 {
+ fimc@0 {
compatible = "samsung,exynos4212-fimc";
- reg = <0x11800000 0x1000>;
+ reg = <0x00000000 0x1000>;
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock CLK_FIMC0>,
<&clock CLK_SCLK_FIMC0>;
@@ -151,9 +151,9 @@ examples:
/* ... FIMC 1-3 */
- csis@11880000 {
+ csis@80000 {
compatible = "samsung,exynos4210-csis";
- reg = <0x11880000 0x4000>;
+ reg = <0x00080000 0x4000>;
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock CLK_CSIS0>,
<&clock CLK_SCLK_CSIS0>;
@@ -186,9 +186,9 @@ examples:
/* ... CSIS 1 */
- fimc-lite@12390000 {
+ fimc-lite@b90000 {
compatible = "samsung,exynos4212-fimc-lite";
- reg = <0x12390000 0x1000>;
+ reg = <0xb90000 0x1000>;
interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&pd_isp>;
clocks = <&isp_clock CLK_ISP_FIMC_LITE0>;
@@ -198,9 +198,9 @@ examples:
/* ... FIMC-LITE 1 */
- fimc-is@12000000 {
+ fimc-is@800000 {
compatible = "samsung,exynos4212-fimc-is";
- reg = <0x12000000 0x260000>;
+ reg = <0x00800000 0x260000>;
interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&isp_clock CLK_ISP_FIMC_LITE0>,
@@ -242,9 +242,9 @@ examples:
#size-cells = <1>;
ranges;
- i2c-isp@12140000 {
+ i2c-isp@940000 {
compatible = "samsung,exynos4212-i2c-isp";
- reg = <0x12140000 0x100>;
+ reg = <0x00940000 0x100>;
clocks = <&isp_clock CLK_ISP_I2C1_ISP>;
clock-names = "i2c_isp";
pinctrl-0 = <&fimc_is_i2c1>;
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle
2023-07-22 11:54 [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle Krzysztof Kozlowski
2023-07-22 11:54 ` [PATCH 2/3] media: dt-bindings: samsung,fimc: correct unit addresses in DTS example Krzysztof Kozlowski
@ 2023-07-22 11:54 ` Krzysztof Kozlowski
2023-08-07 13:06 ` Hans Verkuil
2023-07-24 16:24 ` [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: " Rob Herring
2 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-22 11:54 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Alim Akhtar, linux-media,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
Cc: Krzysztof Kozlowski
Devicetree for the FIMC IS camera included duplicated PMU node as its
child like:
soc@0 {
system-controller@10020000 { ... }; // Real PMU
camera@11800000 {
fimc-is@12000000 {
// FIMC IS camera node
pmu@10020000 {
reg = <0x10020000 0x3000>; // Fake PMU node
};
};
};
};
This is not a correct representation of the hardware. Mapping the PMU
(Power Management Unit) IO memory should be via syscon-like phandle
(samsung,pmu-syscon, already used for other drivers), not by duplicating
"pmu" Devicetree node inside the FIMC IS. Backward compatibility is
preserved.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../platform/samsung/exynos4-is/fimc-is.c | 33 ++++++++++++++-----
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
index 530a148fe4d3..c4c191771093 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
@@ -767,12 +767,32 @@ static void fimc_is_debugfs_create(struct fimc_is *is)
static int fimc_is_runtime_resume(struct device *dev);
static int fimc_is_runtime_suspend(struct device *dev);
+static void __iomem *fimc_is_get_pmu_regs(struct device *dev)
+{
+ struct device_node *node;
+ void __iomem *regs;
+
+ node = of_parse_phandle(dev->of_node, "samsung,pmu-syscon", 0);
+ if (!node) {
+ dev_warn(dev, "Finding PMU node via deprecated method, update your DTB\n");
+ node = of_get_child_by_name(dev->of_node, "pmu");
+ if (!node)
+ return ERR_PTR(-ENODEV);
+ }
+
+ regs = of_iomap(node, 0);
+ of_node_put(node);
+ if (!regs)
+ return ERR_PTR(-ENOMEM);
+
+ return regs;
+}
+
static int fimc_is_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct fimc_is *is;
struct resource res;
- struct device_node *node;
int ret;
is = devm_kzalloc(&pdev->dev, sizeof(*is), GFP_KERNEL);
@@ -794,14 +814,9 @@ static int fimc_is_probe(struct platform_device *pdev)
if (IS_ERR(is->regs))
return PTR_ERR(is->regs);
- node = of_get_child_by_name(dev->of_node, "pmu");
- if (!node)
- return -ENODEV;
-
- is->pmu_regs = of_iomap(node, 0);
- of_node_put(node);
- if (!is->pmu_regs)
- return -ENOMEM;
+ is->pmu_regs = fimc_is_get_pmu_regs(dev);
+ if (IS_ERR(is->pmu_regs))
+ return PTR_ERR(is->pmu_regs);
is->irq = irq_of_parse_and_map(dev->of_node, 0);
if (!is->irq) {
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] media: dt-bindings: samsung,fimc: correct unit addresses in DTS example
2023-07-22 11:54 ` [PATCH 2/3] media: dt-bindings: samsung,fimc: correct unit addresses in DTS example Krzysztof Kozlowski
@ 2023-07-22 12:00 ` Conor Dooley
0 siblings, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2023-07-22 12:00 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Sylwester Nawrocki, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Alim Akhtar, linux-media,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 364 bytes --]
On Sat, Jul 22, 2023 at 01:54:40PM +0200, Krzysztof Kozlowski wrote:
> The camera node's ranges property and unit addresses of its children
> were not correct. If camera is @11800000, then its fimc child is @0.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Cheers,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle
2023-07-22 11:54 [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle Krzysztof Kozlowski
2023-07-22 11:54 ` [PATCH 2/3] media: dt-bindings: samsung,fimc: correct unit addresses in DTS example Krzysztof Kozlowski
2023-07-22 11:54 ` [PATCH 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle Krzysztof Kozlowski
@ 2023-07-24 16:24 ` Rob Herring
2 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2023-07-24 16:24 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: devicetree, Rob Herring, Conor Dooley, linux-samsung-soc,
linux-arm-kernel, Mauro Carvalho Chehab, Alim Akhtar,
linux-kernel, Sylwester Nawrocki, Krzysztof Kozlowski,
linux-media
On Sat, 22 Jul 2023 13:54:39 +0200, Krzysztof Kozlowski wrote:
> The FIMC IS camera must access the PMU (Power Management Unit) IO memory
> to control camera power. This was achieved by duplicating the PMU node
> as its child like:
>
> soc@0 {
> system-controller@10020000 { ... }; // Real PMU
>
> camera@11800000 {
> fimc-is@12000000 {
> // FIMC IS camera node
> pmu@10020000 {
> reg = <0x10020000 0x3000>; // Fake PMU node
> };
> };
> };
> };
>
> This is not a correct representation of the hardware. Mapping the PMU
> (Power Management Unit) IO memory should be via syscon-like phandle
> (samsung,pmu-syscon, already used for other drivers), not by duplicating
> "pmu" Devicetree node inside the FIMC IS.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> .../media/samsung,exynos4212-fimc-is.yaml | 15 ++++++++++-----
> .../devicetree/bindings/media/samsung,fimc.yaml | 5 +----
> 2 files changed, 11 insertions(+), 9 deletions(-)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle
2023-07-22 11:54 ` [PATCH 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle Krzysztof Kozlowski
@ 2023-08-07 13:06 ` Hans Verkuil
2023-08-07 13:09 ` Krzysztof Kozlowski
0 siblings, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2023-08-07 13:06 UTC (permalink / raw)
To: Krzysztof Kozlowski, Sylwester Nawrocki, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
linux-media, devicetree, linux-arm-kernel, linux-samsung-soc,
linux-kernel
Hi Krzysztof,
On 22/07/2023 13:54, Krzysztof Kozlowski wrote:
> Devicetree for the FIMC IS camera included duplicated PMU node as its
> child like:
>
> soc@0 {
> system-controller@10020000 { ... }; // Real PMU
>
> camera@11800000 {
> fimc-is@12000000 {
> // FIMC IS camera node
> pmu@10020000 {
> reg = <0x10020000 0x3000>; // Fake PMU node
> };
> };
> };
> };
>
> This is not a correct representation of the hardware. Mapping the PMU
> (Power Management Unit) IO memory should be via syscon-like phandle
> (samsung,pmu-syscon, already used for other drivers), not by duplicating
> "pmu" Devicetree node inside the FIMC IS. Backward compatibility is
> preserved.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> .../platform/samsung/exynos4-is/fimc-is.c | 33 ++++++++++++++-----
> 1 file changed, 24 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> index 530a148fe4d3..c4c191771093 100644
> --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> @@ -767,12 +767,32 @@ static void fimc_is_debugfs_create(struct fimc_is *is)
> static int fimc_is_runtime_resume(struct device *dev);
> static int fimc_is_runtime_suspend(struct device *dev);
>
> +static void __iomem *fimc_is_get_pmu_regs(struct device *dev)
> +{
> + struct device_node *node;
> + void __iomem *regs;
> +
> + node = of_parse_phandle(dev->of_node, "samsung,pmu-syscon", 0);
> + if (!node) {
> + dev_warn(dev, "Finding PMU node via deprecated method, update your DTB\n");
> + node = of_get_child_by_name(dev->of_node, "pmu");
> + if (!node)
> + return ERR_PTR(-ENODEV);
> + }
> +
> + regs = of_iomap(node, 0);
> + of_node_put(node);
> + if (!regs)
> + return ERR_PTR(-ENOMEM);
sparse gives me these warnings for these ERR_PTR returns:
drivers/media/platform/samsung/exynos4-is/fimc-is.c:780:39: warning: incorrect type in return expression (different address spaces)
drivers/media/platform/samsung/exynos4-is/fimc-is.c:780:39: expected void [noderef] __iomem *
drivers/media/platform/samsung/exynos4-is/fimc-is.c:780:39: got void *
drivers/media/platform/samsung/exynos4-is/fimc-is.c:786:31: warning: incorrect type in return expression (different address spaces)
drivers/media/platform/samsung/exynos4-is/fimc-is.c:786:31: expected void [noderef] __iomem *
drivers/media/platform/samsung/exynos4-is/fimc-is.c:786:31: got void *
Regards,
Hans
> +
> + return regs;
> +}
> +
> static int fimc_is_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct fimc_is *is;
> struct resource res;
> - struct device_node *node;
> int ret;
>
> is = devm_kzalloc(&pdev->dev, sizeof(*is), GFP_KERNEL);
> @@ -794,14 +814,9 @@ static int fimc_is_probe(struct platform_device *pdev)
> if (IS_ERR(is->regs))
> return PTR_ERR(is->regs);
>
> - node = of_get_child_by_name(dev->of_node, "pmu");
> - if (!node)
> - return -ENODEV;
> -
> - is->pmu_regs = of_iomap(node, 0);
> - of_node_put(node);
> - if (!is->pmu_regs)
> - return -ENOMEM;
> + is->pmu_regs = fimc_is_get_pmu_regs(dev);
> + if (IS_ERR(is->pmu_regs))
> + return PTR_ERR(is->pmu_regs);
>
> is->irq = irq_of_parse_and_map(dev->of_node, 0);
> if (!is->irq) {
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle
2023-08-07 13:06 ` Hans Verkuil
@ 2023-08-07 13:09 ` Krzysztof Kozlowski
0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-07 13:09 UTC (permalink / raw)
To: Hans Verkuil, Sylwester Nawrocki, Mauro Carvalho Chehab,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
linux-media, devicetree, linux-arm-kernel, linux-samsung-soc,
linux-kernel
On 07/08/2023 15:06, Hans Verkuil wrote:
> Hi Krzysztof,
>
> On 22/07/2023 13:54, Krzysztof Kozlowski wrote:
>> Devicetree for the FIMC IS camera included duplicated PMU node as its
>> child like:
>>
>> soc@0 {
>> system-controller@10020000 { ... }; // Real PMU
>>
>> camera@11800000 {
>> fimc-is@12000000 {
>> // FIMC IS camera node
>> pmu@10020000 {
>> reg = <0x10020000 0x3000>; // Fake PMU node
>> };
>> };
>> };
>> };
>>
>> This is not a correct representation of the hardware. Mapping the PMU
>> (Power Management Unit) IO memory should be via syscon-like phandle
>> (samsung,pmu-syscon, already used for other drivers), not by duplicating
>> "pmu" Devicetree node inside the FIMC IS. Backward compatibility is
>> preserved.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>> .../platform/samsung/exynos4-is/fimc-is.c | 33 ++++++++++++++-----
>> 1 file changed, 24 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
>> index 530a148fe4d3..c4c191771093 100644
>> --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
>> +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
>> @@ -767,12 +767,32 @@ static void fimc_is_debugfs_create(struct fimc_is *is)
>> static int fimc_is_runtime_resume(struct device *dev);
>> static int fimc_is_runtime_suspend(struct device *dev);
>>
>> +static void __iomem *fimc_is_get_pmu_regs(struct device *dev)
>> +{
>> + struct device_node *node;
>> + void __iomem *regs;
>> +
>> + node = of_parse_phandle(dev->of_node, "samsung,pmu-syscon", 0);
>> + if (!node) {
>> + dev_warn(dev, "Finding PMU node via deprecated method, update your DTB\n");
>> + node = of_get_child_by_name(dev->of_node, "pmu");
>> + if (!node)
>> + return ERR_PTR(-ENODEV);
>> + }
>> +
>> + regs = of_iomap(node, 0);
>> + of_node_put(node);
>> + if (!regs)
>> + return ERR_PTR(-ENOMEM);
>
> sparse gives me these warnings for these ERR_PTR returns:
>
> drivers/media/platform/samsung/exynos4-is/fimc-is.c:780:39: warning: incorrect type in return expression (different address spaces)
> drivers/media/platform/samsung/exynos4-is/fimc-is.c:780:39: expected void [noderef] __iomem *
> drivers/media/platform/samsung/exynos4-is/fimc-is.c:780:39: got void *
Thanks, indeed. I will use IOMEM_ERR_PTR()
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-08-07 13:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-22 11:54 [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle Krzysztof Kozlowski
2023-07-22 11:54 ` [PATCH 2/3] media: dt-bindings: samsung,fimc: correct unit addresses in DTS example Krzysztof Kozlowski
2023-07-22 12:00 ` Conor Dooley
2023-07-22 11:54 ` [PATCH 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle Krzysztof Kozlowski
2023-08-07 13:06 ` Hans Verkuil
2023-08-07 13:09 ` Krzysztof Kozlowski
2023-07-24 16:24 ` [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: " Rob Herring
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).