All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: thc63lvd1024: Fix regulator_get_optional() misuse
@ 2019-11-08 17:32 Mark Brown
  2020-12-15 20:55 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2019-11-08 17:32 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, David Airlie, Daniel Vetter
  Cc: Mark Brown, dri-devel

The thc63lvd1024 driver requests a supply using regulator_get_optional()
but both the name of the supply and the usage pattern suggest that it is
being used for the main power for the device and is not at all optional
for the device for function, there is no handling at all for absent
supplies.  Such regulators should use the vanilla regulator_get()
interface, it will ensure that even if a supply is not described in the
system integration one will be provided in software.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/gpu/drm/bridge/thc63lvd1024.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c
index 3d74129b2995..ffca28ccc2c4 100644
--- a/drivers/gpu/drm/bridge/thc63lvd1024.c
+++ b/drivers/gpu/drm/bridge/thc63lvd1024.c
@@ -200,7 +200,7 @@ static int thc63_probe(struct platform_device *pdev)
 	thc63->dev = &pdev->dev;
 	platform_set_drvdata(pdev, thc63);
 
-	thc63->vcc = devm_regulator_get_optional(thc63->dev, "vcc");
+	thc63->vcc = devm_regulator_get(thc63->dev, "vcc");
 	if (IS_ERR(thc63->vcc)) {
 		if (PTR_ERR(thc63->vcc) == -EPROBE_DEFER)
 			return -EPROBE_DEFER;
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/bridge: thc63lvd1024: Fix regulator_get_optional() misuse
  2019-11-08 17:32 [PATCH] drm/bridge: thc63lvd1024: Fix regulator_get_optional() misuse Mark Brown
@ 2020-12-15 20:55 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2020-12-15 20:55 UTC (permalink / raw)
  To: Mark Brown
  Cc: Jernej Skrabec, Jonas Karlman, David Airlie, Neil Armstrong,
	dri-devel, Andrzej Hajda

Hi Mark,

Thank you for the patch.

On Fri, Nov 08, 2019 at 05:32:08PM +0000, Mark Brown wrote:
> The thc63lvd1024 driver requests a supply using regulator_get_optional()
> but both the name of the supply and the usage pattern suggest that it is
> being used for the main power for the device and is not at all optional
> for the device for function, there is no handling at all for absent
> supplies.  Such regulators should use the vanilla regulator_get()
> interface, it will ensure that even if a supply is not described in the
> system integration one will be provided in software.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and queued in my tree for v5.12.

> ---
>  drivers/gpu/drm/bridge/thc63lvd1024.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c
> index 3d74129b2995..ffca28ccc2c4 100644
> --- a/drivers/gpu/drm/bridge/thc63lvd1024.c
> +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c
> @@ -200,7 +200,7 @@ static int thc63_probe(struct platform_device *pdev)
>  	thc63->dev = &pdev->dev;
>  	platform_set_drvdata(pdev, thc63);
>  
> -	thc63->vcc = devm_regulator_get_optional(thc63->dev, "vcc");
> +	thc63->vcc = devm_regulator_get(thc63->dev, "vcc");
>  	if (IS_ERR(thc63->vcc)) {
>  		if (PTR_ERR(thc63->vcc) == -EPROBE_DEFER)
>  			return -EPROBE_DEFER;

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-15 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 17:32 [PATCH] drm/bridge: thc63lvd1024: Fix regulator_get_optional() misuse Mark Brown
2020-12-15 20:55 ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.