diff mbox series

[07/22] drm/i2c/tda998x: Use simple encoder

Message ID 20200305155950.2705-8-tzimmermann@suse.de (mailing list archive)
State New, archived
Headers show
Series drm: Convert drivers to drm_simple_encoder_init() | expand

Commit Message

Thomas Zimmermann March 5, 2020, 3:59 p.m. UTC
The tda998x driver uses an empty implementation for its encoder. Replace
the code with the generic simple encoder.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

Comments

kernel test robot March 6, 2020, 7:30 a.m. UTC | #1
Hi Thomas,

I love your patch! Yet something to improve:

[auto build test ERROR on next-20200305]
[also build test ERROR on v5.6-rc4]
[cannot apply to rockchip/for-next shawnguo/for-next sunxi/sunxi/for-next tegra/for-next linus/master v5.6-rc4 v5.6-rc3 v5.6-rc2]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Convert-drivers-to-drm_simple_encoder_init/20200306-045931
base:    47466dcf84ee66a973ea7d2fca7e582fe9328932
config: arm64-defconfig (attached as .config)
compiler: clang version 11.0.0 (git://gitmirror/llvm_project a0cd413426479abb207381bdbab862f3dfb3ce7d)
reproduce:
        # FIXME the reproduce steps for clang is not ready yet

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i2c/tda998x_drv.c:2018:8: error: implicit declaration of function 'drm_simple_encoder_init' [-Werror,-Wimplicit-function-declaration]
           ret = drm_simple_encoder_init(drm, &priv->encoder,
                 ^
   drivers/gpu/drm/i2c/tda998x_drv.c:2018:8: note: did you mean 'drm_encoder_init'?
   include/drm/drm_encoder.h:189:5: note: 'drm_encoder_init' declared here
   int drm_encoder_init(struct drm_device *dev,
       ^
   1 error generated.

vim +/drm_simple_encoder_init +2018 drivers/gpu/drm/i2c/tda998x_drv.c

  2000	
  2001	static int tda998x_encoder_init(struct device *dev, struct drm_device *drm)
  2002	{
  2003		struct tda998x_priv *priv = dev_get_drvdata(dev);
  2004		u32 crtcs = 0;
  2005		int ret;
  2006	
  2007		if (dev->of_node)
  2008			crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);
  2009	
  2010		/* If no CRTCs were found, fall back to our old behaviour */
  2011		if (crtcs == 0) {
  2012			dev_warn(dev, "Falling back to first CRTC\n");
  2013			crtcs = 1 << 0;
  2014		}
  2015	
  2016		priv->encoder.possible_crtcs = crtcs;
  2017	
> 2018		ret = drm_simple_encoder_init(drm, &priv->encoder,
  2019					      DRM_MODE_ENCODER_TMDS);
  2020		if (ret)
  2021			goto err_encoder;
  2022	
  2023		ret = drm_bridge_attach(&priv->encoder, &priv->bridge, NULL, 0);
  2024		if (ret)
  2025			goto err_bridge;
  2026	
  2027		return 0;
  2028	
  2029	err_bridge:
  2030		drm_encoder_cleanup(&priv->encoder);
  2031	err_encoder:
  2032		return ret;
  2033	}
  2034	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot March 7, 2020, 3:40 p.m. UTC | #2
Hi Thomas,

I love your patch! Yet something to improve:

[auto build test ERROR on next-20200305]
[also build test ERROR on v5.6-rc4]
[cannot apply to rockchip/for-next shawnguo/for-next sunxi/sunxi/for-next tegra/for-next linus/master v5.6-rc4 v5.6-rc3 v5.6-rc2]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Convert-drivers-to-drm_simple_encoder_init/20200306-045931
base:    47466dcf84ee66a973ea7d2fca7e582fe9328932
config: x86_64-randconfig-h002-20200307 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-5) 7.5.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/gpu/drm/i2c/tda998x_drv.c: In function 'tda998x_encoder_init':
>> drivers/gpu/drm/i2c/tda998x_drv.c:2018:8: error: implicit declaration of function 'drm_simple_encoder_init'; did you mean 'drm_encoder_init'? [-Werror=implicit-function-declaration]
     ret = drm_simple_encoder_init(drm, &priv->encoder,
           ^~~~~~~~~~~~~~~~~~~~~~~
           drm_encoder_init
   cc1: some warnings being treated as errors

vim +2018 drivers/gpu/drm/i2c/tda998x_drv.c

  2000	
  2001	static int tda998x_encoder_init(struct device *dev, struct drm_device *drm)
  2002	{
  2003		struct tda998x_priv *priv = dev_get_drvdata(dev);
  2004		u32 crtcs = 0;
  2005		int ret;
  2006	
  2007		if (dev->of_node)
  2008			crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);
  2009	
  2010		/* If no CRTCs were found, fall back to our old behaviour */
  2011		if (crtcs == 0) {
  2012			dev_warn(dev, "Falling back to first CRTC\n");
  2013			crtcs = 1 << 0;
  2014		}
  2015	
  2016		priv->encoder.possible_crtcs = crtcs;
  2017	
> 2018		ret = drm_simple_encoder_init(drm, &priv->encoder,
  2019					      DRM_MODE_ENCODER_TMDS);
  2020		if (ret)
  2021			goto err_encoder;
  2022	
  2023		ret = drm_bridge_attach(&priv->encoder, &priv->bridge, NULL, 0);
  2024		if (ret)
  2025			goto err_bridge;
  2026	
  2027		return 0;
  2028	
  2029	err_bridge:
  2030		drm_encoder_cleanup(&priv->encoder);
  2031	err_encoder:
  2032		return ret;
  2033	}
  2034	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index c3332209f27a..0e1a90f70ec0 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -19,6 +19,7 @@ 
 #include <drm/drm_of.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
 #include <drm/i2c/tda998x.h>
 
 #include <media/cec-notifier.h>
@@ -1997,15 +1998,6 @@  static int tda998x_create(struct device *dev)
 
 /* DRM encoder functions */
 
-static void tda998x_encoder_destroy(struct drm_encoder *encoder)
-{
-	drm_encoder_cleanup(encoder);
-}
-
-static const struct drm_encoder_funcs tda998x_encoder_funcs = {
-	.destroy = tda998x_encoder_destroy,
-};
-
 static int tda998x_encoder_init(struct device *dev, struct drm_device *drm)
 {
 	struct tda998x_priv *priv = dev_get_drvdata(dev);
@@ -2023,8 +2015,8 @@  static int tda998x_encoder_init(struct device *dev, struct drm_device *drm)
 
 	priv->encoder.possible_crtcs = crtcs;
 
-	ret = drm_encoder_init(drm, &priv->encoder, &tda998x_encoder_funcs,
-			       DRM_MODE_ENCODER_TMDS, NULL);
+	ret = drm_simple_encoder_init(drm, &priv->encoder,
+				      DRM_MODE_ENCODER_TMDS);
 	if (ret)
 		goto err_encoder;