* [PATCH v2 1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe
@ 2024-05-29 6:53 Alexander Stein
2024-05-29 7:50 ` Liu Ying
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2024-05-29 6:53 UTC (permalink / raw)
To: Liu Ying, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Daniel Vetter, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam
Cc: Alexander Stein, dri-devel, imx, linux-arm-kernel, linux-kernel
Although very unlike to occur (media_blk_ctrl needs 'syscon' compatible
removed), it lines up with the other error paths in probe function.
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
Changes in v2:
* Removed unused variable
* Added missing \n at end of string
drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
index 2347f8dd632f9..13025f47f3902 100644
--- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
@@ -834,18 +834,15 @@ static int imx93_dsi_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct imx93_dsi *dsi;
- int ret;
dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
if (!dsi)
return -ENOMEM;
dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-blk-ctrl");
- if (IS_ERR(dsi->regmap)) {
- ret = PTR_ERR(dsi->regmap);
- dev_err(dev, "failed to get block ctrl regmap: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(dsi->regmap))
+ return dev_err_probe(dev, PTR_ERR(dsi->regmap),
+ "failed to get block ctrl regmap\n");
dsi->clk_pixel = devm_clk_get(dev, "pix");
if (IS_ERR(dsi->clk_pixel))
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe
2024-05-29 6:53 [PATCH v2 1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe Alexander Stein
@ 2024-05-29 7:50 ` Liu Ying
2024-05-29 8:15 ` Alexander Stein
0 siblings, 1 reply; 4+ messages in thread
From: Liu Ying @ 2024-05-29 7:50 UTC (permalink / raw)
To: Alexander Stein, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Daniel Vetter, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam
Cc: dri-devel, imx, linux-arm-kernel, linux-kernel
On 05/29/2024, Alexander Stein wrote:
> Although very unlike to occur (media_blk_ctrl needs 'syscon' compatible
> removed), it lines up with the other error paths in probe function.
Why media_blk_ctrl needs 'syscon' compatible removed?
device_node_get_regmap may return error pointer other than
ERR_PTR(-EPROBE_DEFER), like ERR_PTR(-ENOMEM).
struct regmap *syscon_node_to_regmap(struct device_node *np)
{
if (!of_device_is_compatible(np, "syscon"))
return ERR_PTR(-EINVAL);
return device_node_get_regmap(np, true);
}
EXPORT_SYMBOL_GPL(syscon_node_to_regmap);
Regard,
Liu Ying
>
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> Changes in v2:
> * Removed unused variable
> * Added missing \n at end of string
>
> drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> index 2347f8dd632f9..13025f47f3902 100644
> --- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> @@ -834,18 +834,15 @@ static int imx93_dsi_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct device_node *np = dev->of_node;
> struct imx93_dsi *dsi;
> - int ret;
>
> dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
> if (!dsi)
> return -ENOMEM;
>
> dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-blk-ctrl");
> - if (IS_ERR(dsi->regmap)) {
> - ret = PTR_ERR(dsi->regmap);
> - dev_err(dev, "failed to get block ctrl regmap: %d\n", ret);
> - return ret;
> - }
> + if (IS_ERR(dsi->regmap))
> + return dev_err_probe(dev, PTR_ERR(dsi->regmap),
> + "failed to get block ctrl regmap\n");
>
> dsi->clk_pixel = devm_clk_get(dev, "pix");
> if (IS_ERR(dsi->clk_pixel))
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe
2024-05-29 7:50 ` Liu Ying
@ 2024-05-29 8:15 ` Alexander Stein
2024-05-29 8:32 ` Liu Ying
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2024-05-29 8:15 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Liu Ying
Cc: dri-devel, imx, linux-arm-kernel, linux-kernel
Hi,
Am Mittwoch, 29. Mai 2024, 09:50:24 CEST schrieb Liu Ying:
> On 05/29/2024, Alexander Stein wrote:
> > Although very unlike to occur (media_blk_ctrl needs 'syscon' compatible
> > removed), it lines up with the other error paths in probe function.
>
> Why media_blk_ctrl needs 'syscon' compatible removed?
No, it does not. As media_blk_ctrl is also used as power-domain the device
will not even be probed if media_blk_ctrl is not available.
I just mentioned it under which conditions this error path could happen.
Best regards,
Alexander
> device_node_get_regmap may return error pointer other than
> ERR_PTR(-EPROBE_DEFER), like ERR_PTR(-ENOMEM).
>
> struct regmap *syscon_node_to_regmap(struct device_node *np)
> {
> if (!of_device_is_compatible(np, "syscon"))
> return ERR_PTR(-EINVAL);
>
> return device_node_get_regmap(np, true);
> }
> EXPORT_SYMBOL_GPL(syscon_node_to_regmap);
>
> Regard,
> Liu Ying
>
> >
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > ---
> > Changes in v2:
> > * Removed unused variable
> > * Added missing \n at end of string
> >
> > drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 9 +++------
> > 1 file changed, 3 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > index 2347f8dd632f9..13025f47f3902 100644
> > --- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > @@ -834,18 +834,15 @@ static int imx93_dsi_probe(struct platform_device *pdev)
> > struct device *dev = &pdev->dev;
> > struct device_node *np = dev->of_node;
> > struct imx93_dsi *dsi;
> > - int ret;
> >
> > dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
> > if (!dsi)
> > return -ENOMEM;
> >
> > dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-blk-ctrl");
> > - if (IS_ERR(dsi->regmap)) {
> > - ret = PTR_ERR(dsi->regmap);
> > - dev_err(dev, "failed to get block ctrl regmap: %d\n", ret);
> > - return ret;
> > - }
> > + if (IS_ERR(dsi->regmap))
> > + return dev_err_probe(dev, PTR_ERR(dsi->regmap),
> > + "failed to get block ctrl regmap\n");
> >
> > dsi->clk_pixel = devm_clk_get(dev, "pix");
> > if (IS_ERR(dsi->clk_pixel))
>
>
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe
2024-05-29 8:15 ` Alexander Stein
@ 2024-05-29 8:32 ` Liu Ying
0 siblings, 0 replies; 4+ messages in thread
From: Liu Ying @ 2024-05-29 8:32 UTC (permalink / raw)
To: Alexander Stein, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Daniel Vetter, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam
Cc: dri-devel, imx, linux-arm-kernel, linux-kernel
On 05/29/2024, Alexander Stein wrote:
> Hi,
>
> Am Mittwoch, 29. Mai 2024, 09:50:24 CEST schrieb Liu Ying:
>> On 05/29/2024, Alexander Stein wrote:
>>> Although very unlike to occur (media_blk_ctrl needs 'syscon' compatible
>>> removed), it lines up with the other error paths in probe function.
>>
>> Why media_blk_ctrl needs 'syscon' compatible removed?
>
> No, it does not. As media_blk_ctrl is also used as power-domain the device
> will not even be probed if media_blk_ctrl is not available.
> I just mentioned it under which conditions this error path could happen.
The error path you mentioned returns ERR_PTR(-EINVAL) which
doesn't make sense to use dev_err_probe. ERR_PTR(-EPROBE_DEFER)
is the one in question.
>
> Best regards,
> Alexander
>
>> device_node_get_regmap may return error pointer other than
>> ERR_PTR(-EPROBE_DEFER), like ERR_PTR(-ENOMEM).
>>
>> struct regmap *syscon_node_to_regmap(struct device_node *np)
>> {
>> if (!of_device_is_compatible(np, "syscon"))
>> return ERR_PTR(-EINVAL);
>>
>> return device_node_get_regmap(np, true);
>> }
>> EXPORT_SYMBOL_GPL(syscon_node_to_regmap);
>>
>> Regard,
>> Liu Ying
>>
>>>
>>> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
>>> ---
>>> Changes in v2:
>>> * Removed unused variable
>>> * Added missing \n at end of string
>>>
>>> drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 9 +++------
>>> 1 file changed, 3 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
>>> index 2347f8dd632f9..13025f47f3902 100644
>>> --- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
>>> +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
>>> @@ -834,18 +834,15 @@ static int imx93_dsi_probe(struct platform_device *pdev)
>>> struct device *dev = &pdev->dev;
>>> struct device_node *np = dev->of_node;
>>> struct imx93_dsi *dsi;
>>> - int ret;
>>>
>>> dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
>>> if (!dsi)
>>> return -ENOMEM;
>>>
>>> dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-blk-ctrl");
>>> - if (IS_ERR(dsi->regmap)) {
>>> - ret = PTR_ERR(dsi->regmap);
>>> - dev_err(dev, "failed to get block ctrl regmap: %d\n", ret);
>>> - return ret;
>>> - }
>>> + if (IS_ERR(dsi->regmap))
>>> + return dev_err_probe(dev, PTR_ERR(dsi->regmap),
>>> + "failed to get block ctrl regmap\n");
>>>
>>> dsi->clk_pixel = devm_clk_get(dev, "pix");
>>> if (IS_ERR(dsi->clk_pixel))
>>
>>
>
>
--
Regards,
Liu Ying
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-29 8:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 6:53 [PATCH v2 1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe Alexander Stein
2024-05-29 7:50 ` Liu Ying
2024-05-29 8:15 ` Alexander Stein
2024-05-29 8:32 ` Liu Ying
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox