Skip to contentSkip to conversation

drm/tiny: sharp-memory: handle enable GPIO errors

PATCH New [email protected] 1 participant 1 message Oct 7

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

PATCH 1/1 drm/tiny: sharp-memory: handle enable GPIO errors

From: bui duc phuc <[email protected]>

devm_gpiod_get_optional() may return -EPROBE_DEFER or other errors, but sharp_memory_probe() currently ignores them.

Check the return value and propagate errors from the enable GPIO lookup.

Fixes b8f9f21716fe ("drm/tiny: Add driver for Sharp Memory LCD")
---
 drivers/gpu/drm/tiny/sharp-memory.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/tiny/sharp-memory.c +3 -0
index 7efd7b567f3b..35254a2136c9 100644
@@ -552,6 +552,9 @@ static int sharp_memory_probe(struct spi_device *spi)
 		return dev_err_probe(dev, ret, "Failed to initialize drm config\n");
 
 	smd->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);
+	if (IS_ERR(smd->enable_gpio))
+		return dev_err_probe(dev, PTR_ERR(smd->enable_gpio),
+				     "Failed to get enable gpio\n");
 	if (!smd->enable_gpio)
 		dev_warn(dev, "Enable gpio not defined\n");
 
Signature · 1 line
2.43.0