drm/tiny: sharp-memory: handle enable GPIO errors
Subsystems (3)
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")
Signed-off-by bui duc phuc <[email protected]>
--- drivers/gpu/drm/tiny/sharp-memory.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/tiny/sharp-memory.c +3 -0
@@ -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