imx-drm: imx-tve: Check the return value of 'regulator_enable()'
Subsystems (2)
PATCH v2 1/3 imx-drm: imx-tve: Check the return value of 'regulator_enable()'
Since commit c8801a8 (regulator: core: Mark all get and enable calls as __must_check) we need to check the value returned by 'regulator_enable()'.
Do this check to get rid of the following build warning:
drivers/staging/imx-drm/imx-tve.c: In function 'imx_tve_probe':drivers/staging/imx-drm/imx-tve.c:671:19: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result]
---
Changes since v1:
- Use 'build warning' instead of 'build error' in commit log
- Also mention the commit that requires the checking
- Added Ack's
drivers/staging/imx-drm/imx-tve.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/imx-drm/imx-tve.c +3 -1
@@ -668,7 +668,9 @@ static int imx_tve_probe(struct platform_device *pdev) tve->dac_reg =devm_regulator_get (&pdev->dev,"dac" );if (!IS_ERR (tve->dac_reg)) {regulator_set_voltage (tve->dac_reg,2750000 ,2750000 ); -regulator_enable (tve->dac_reg); + ret =regulator_enable (tve->dac_reg); +if (ret) +return ret; } tve->clk =devm_clk_get (&pdev->dev,"tve" );
Signature · 1 line
1.8.1.2
PATCH v2 2/3 imx-drm: imx-tve: Let device core handle pinctrl
Since commit ab78029 (drivers/pinctrl: grab default handles from device core) we can rely on device core for handling pinctrl, so remove devm_pinctrl_get_select_default() from the driver.
---
Changes since v1:
- Added Ack's
drivers/staging/imx-drm/imx-tve.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/staging/imx-drm/imx-tve.c +0 -10
@@ -22,7 +22,6 @@#include <linux/clk-provider.h> #include <linux/module.h> #include <linux/of_i2c.h> -#include <linux/pinctrl/consumer.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> #include <linux/spinlock.h>
@@ -610,15 +609,6 @@ static int imx_tve_probe(struct platform_device *pdev) }if (tve->mode ==TVE_MODE_VGA ) { -struct pinctrl *pinctrl; - - pinctrl =devm_pinctrl_get_select_default (&pdev->dev); -if (IS_ERR (pinctrl)) { - ret =PTR_ERR (pinctrl); -dev_warn (&pdev->dev,"failed to setup pinctrl: %d" , ret); -return ret; - } - ret =of_property_read_u32 (np,"fsl,hsync-pin" , &tve->hsync_pin);if (ret <0 ) {dev_err (&pdev->dev,"failed to get vsync pin\n" );
Signature · 1 line
1.8.1.2
PATCH v2 3/3 imx-drm: parallel-display: Let device core handle pinctrl
In reply to Fabio EstevamSince commit ab78029 (drivers/pinctrl: grab default handles from device core) we can rely on device core for handling pinctrl, so remove devm_pinctrl_get_select_default() from the driver.
---
Changes since v1:
- Added Ack's
drivers/staging/imx-drm/parallel-display.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/staging/imx-drm/parallel-display.c +0 -10
@@ -23,7 +23,6 @@#include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h> #include <linux/videodev2.h> -#include <linux/pinctrl/consumer.h> #include "imx-drm.h"
@@ -206,20 +205,11 @@ static int imx_pd_probe(struct platform_device *pdev)struct imx_parallel_display *imxpd;int ret;const char *fmt; -struct pinctrl *pinctrl; imxpd =devm_kzalloc (&pdev->dev,sizeof (*imxpd),GFP_KERNEL );if (!imxpd)return -ENOMEM ; - pinctrl =devm_pinctrl_get_select_default (&pdev->dev); -if (IS_ERR (pinctrl)) { - ret =PTR_ERR (pinctrl); -dev_warn (&pdev->dev,"pinctrl_get_select_default failed with %d" , - ret); -return ret; - } - edidp =of_get_property (np,"edid" , &imxpd->edid_len);if (edidp) imxpd->edid =kmemdup (edidp, imxpd->edid_len,GFP_KERNEL );
Signature · 1 line
1.8.1.2