[Intel-gfx] [drm-intel:topic/drm-misc 10/25] drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c:140:18: error: passing argument 1 of 'dc_ops->cleanup' from incompatible pointer type

kbuild test robot fengguang.wu at intel.com
Tue Aug 16 20:00:28 UTC 2016


tree:   git://anongit.freedesktop.org/drm-intel topic/drm-misc
head:   5ee4c8f064719f5c62ea53f304845f75f87f2804
commit: d25bcfb8c2e18b9b36f037f38be4d4792ebf8d57 [10/25] drm/hisilicon: Don't set drm_device->platformdev
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout d25bcfb8c2e18b9b36f037f38be4d4792ebf8d57
        # save the attached .config to linux build tree
        make.cross ARCH=arm64 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/list.h:8:0,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:17,
                    from include/linux/of_platform.h:14,
                    from drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c:18:
   drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c: In function 'kirin_drm_kms_init':
   include/linux/kernel.h:831:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                   ^
>> include/linux/platform_device.h:43:31: note: in expansion of macro 'container_of'
    #define to_platform_device(x) container_of((x), struct platform_device, dev)
                                  ^
>> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c:106:21: note: in expansion of macro 'to_platform_device'
     ret = dc_ops->init(to_platform_device(dev));
                        ^
>> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c:140:18: error: passing argument 1 of 'dc_ops->cleanup' from incompatible pointer type [-Werror=incompatible-pointer-types]
     dc_ops->cleanup(dev);
                     ^
   drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c:140:18: note: expected 'struct platform_device *' but argument is of type 'struct drm_device *'
   cc1: some warnings being treated as errors
--
   drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c: In function 'ade_drm_init':
>> drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c:994:52: error: 'dev' undeclared (first use in this function)
     struct drm_device *drm_dev = platform_get_drvdata(dev);
                                                       ^
   drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c:994:52: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c:994:21: warning: unused variable 'drm_dev' [-Wunused-variable]
     struct drm_device *drm_dev = platform_get_drvdata(dev);
                        ^
   drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c: In function 'ade_drm_cleanup':
   drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c:1055:52: error: 'dev' undeclared (first use in this function)
     struct drm_device *drm_dev = platform_get_drvdata(dev);
                                                       ^
   drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c:1055:21: warning: unused variable 'drm_dev' [-Wunused-variable]
     struct drm_device *drm_dev = platform_get_drvdata(dev);
                        ^
   drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c: At top level:
>> drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c:1065:1: error: expected '}' before ';' token
    ;
    ^

vim +140 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c

23e7b2ab9 Xinliang Liu  2015-10-09   12   * This program is free software; you can redistribute it and/or modify
23e7b2ab9 Xinliang Liu  2015-10-09   13   * it under the terms of the GNU General Public License version 2 as
23e7b2ab9 Xinliang Liu  2015-10-09   14   * published by the Free Software Foundation.
23e7b2ab9 Xinliang Liu  2015-10-09   15   *
23e7b2ab9 Xinliang Liu  2015-10-09   16   */
23e7b2ab9 Xinliang Liu  2015-10-09   17  
23e7b2ab9 Xinliang Liu  2015-10-09  @18  #include <linux/of_platform.h>
23e7b2ab9 Xinliang Liu  2015-10-09   19  #include <linux/component.h>
23e7b2ab9 Xinliang Liu  2015-10-09   20  #include <linux/of_graph.h>
23e7b2ab9 Xinliang Liu  2015-10-09   21  
23e7b2ab9 Xinliang Liu  2015-10-09   22  #include <drm/drmP.h>
23e7b2ab9 Xinliang Liu  2015-10-09   23  #include <drm/drm_gem_cma_helper.h>
23e7b2ab9 Xinliang Liu  2015-10-09   24  #include <drm/drm_fb_cma_helper.h>
23e7b2ab9 Xinliang Liu  2015-10-09   25  #include <drm/drm_atomic_helper.h>
6b7a59654 Xinliang Liu  2015-10-10   26  #include <drm/drm_crtc_helper.h>
23e7b2ab9 Xinliang Liu  2015-10-09   27  
23e7b2ab9 Xinliang Liu  2015-10-09   28  #include "kirin_drm_drv.h"
23e7b2ab9 Xinliang Liu  2015-10-09   29  
23e7b2ab9 Xinliang Liu  2015-10-09   30  static struct kirin_dc_ops *dc_ops;
23e7b2ab9 Xinliang Liu  2015-10-09   31  
23e7b2ab9 Xinliang Liu  2015-10-09   32  static int kirin_drm_kms_cleanup(struct drm_device *dev)
23e7b2ab9 Xinliang Liu  2015-10-09   33  {
783ad972c Xinliang Liu  2015-10-10   34  	struct kirin_drm_private *priv = dev->dev_private;
783ad972c Xinliang Liu  2015-10-10   35  
6b7a59654 Xinliang Liu  2015-10-10   36  #ifdef CONFIG_DRM_FBDEV_EMULATION
6b7a59654 Xinliang Liu  2015-10-10   37  	if (priv->fbdev) {
6b7a59654 Xinliang Liu  2015-10-10   38  		drm_fbdev_cma_fini(priv->fbdev);
6b7a59654 Xinliang Liu  2015-10-10   39  		priv->fbdev = NULL;
6b7a59654 Xinliang Liu  2015-10-10   40  	}
6b7a59654 Xinliang Liu  2015-10-10   41  #endif
6b7a59654 Xinliang Liu  2015-10-10   42  	drm_kms_helper_poll_fini(dev);
bc4611e80 Xinliang Liu  2015-10-10   43  	drm_vblank_cleanup(dev);
d25bcfb8c Daniel Vetter 2016-08-12   44  	dc_ops->cleanup(to_platform_device(dev->dev));
23e7b2ab9 Xinliang Liu  2015-10-09   45  	drm_mode_config_cleanup(dev);
783ad972c Xinliang Liu  2015-10-10   46  	devm_kfree(dev->dev, priv);
783ad972c Xinliang Liu  2015-10-10   47  	dev->dev_private = NULL;
23e7b2ab9 Xinliang Liu  2015-10-09   48  
23e7b2ab9 Xinliang Liu  2015-10-09   49  	return 0;
23e7b2ab9 Xinliang Liu  2015-10-09   50  }
23e7b2ab9 Xinliang Liu  2015-10-09   51  
6b7a59654 Xinliang Liu  2015-10-10   52  #ifdef CONFIG_DRM_FBDEV_EMULATION
6b7a59654 Xinliang Liu  2015-10-10   53  static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
6b7a59654 Xinliang Liu  2015-10-10   54  {
6b7a59654 Xinliang Liu  2015-10-10   55  	struct kirin_drm_private *priv = dev->dev_private;
6b7a59654 Xinliang Liu  2015-10-10   56  
6b7a59654 Xinliang Liu  2015-10-10   57  	if (priv->fbdev) {
6b7a59654 Xinliang Liu  2015-10-10   58  		drm_fbdev_cma_hotplug_event(priv->fbdev);
6b7a59654 Xinliang Liu  2015-10-10   59  	} else {
6b7a59654 Xinliang Liu  2015-10-10   60  		priv->fbdev = drm_fbdev_cma_init(dev, 32,
6b7a59654 Xinliang Liu  2015-10-10   61  				dev->mode_config.num_crtc,
6b7a59654 Xinliang Liu  2015-10-10   62  				dev->mode_config.num_connector);
6b7a59654 Xinliang Liu  2015-10-10   63  		if (IS_ERR(priv->fbdev))
6b7a59654 Xinliang Liu  2015-10-10   64  			priv->fbdev = NULL;
6b7a59654 Xinliang Liu  2015-10-10   65  	}
6b7a59654 Xinliang Liu  2015-10-10   66  }
6b7a59654 Xinliang Liu  2015-10-10   67  #endif
6b7a59654 Xinliang Liu  2015-10-10   68  
23e7b2ab9 Xinliang Liu  2015-10-09   69  static const struct drm_mode_config_funcs kirin_drm_mode_config_funcs = {
23e7b2ab9 Xinliang Liu  2015-10-09   70  	.fb_create = drm_fb_cma_create,
6b7a59654 Xinliang Liu  2015-10-10   71  #ifdef CONFIG_DRM_FBDEV_EMULATION
6b7a59654 Xinliang Liu  2015-10-10   72  	.output_poll_changed = kirin_fbdev_output_poll_changed,
6b7a59654 Xinliang Liu  2015-10-10   73  #endif
23e7b2ab9 Xinliang Liu  2015-10-09   74  	.atomic_check = drm_atomic_helper_check,
23e7b2ab9 Xinliang Liu  2015-10-09   75  	.atomic_commit = drm_atomic_helper_commit,
23e7b2ab9 Xinliang Liu  2015-10-09   76  };
23e7b2ab9 Xinliang Liu  2015-10-09   77  
23e7b2ab9 Xinliang Liu  2015-10-09   78  static void kirin_drm_mode_config_init(struct drm_device *dev)
23e7b2ab9 Xinliang Liu  2015-10-09   79  {
23e7b2ab9 Xinliang Liu  2015-10-09   80  	dev->mode_config.min_width = 0;
23e7b2ab9 Xinliang Liu  2015-10-09   81  	dev->mode_config.min_height = 0;
23e7b2ab9 Xinliang Liu  2015-10-09   82  
23e7b2ab9 Xinliang Liu  2015-10-09   83  	dev->mode_config.max_width = 2048;
23e7b2ab9 Xinliang Liu  2015-10-09   84  	dev->mode_config.max_height = 2048;
23e7b2ab9 Xinliang Liu  2015-10-09   85  
23e7b2ab9 Xinliang Liu  2015-10-09   86  	dev->mode_config.funcs = &kirin_drm_mode_config_funcs;
23e7b2ab9 Xinliang Liu  2015-10-09   87  }
23e7b2ab9 Xinliang Liu  2015-10-09   88  
23e7b2ab9 Xinliang Liu  2015-10-09   89  static int kirin_drm_kms_init(struct drm_device *dev)
23e7b2ab9 Xinliang Liu  2015-10-09   90  {
783ad972c Xinliang Liu  2015-10-10   91  	struct kirin_drm_private *priv;
23e7b2ab9 Xinliang Liu  2015-10-09   92  	int ret;
23e7b2ab9 Xinliang Liu  2015-10-09   93  
783ad972c Xinliang Liu  2015-10-10   94  	priv = devm_kzalloc(dev->dev, sizeof(*priv), GFP_KERNEL);
783ad972c Xinliang Liu  2015-10-10   95  	if (!priv)
783ad972c Xinliang Liu  2015-10-10   96  		return -ENOMEM;
783ad972c Xinliang Liu  2015-10-10   97  
783ad972c Xinliang Liu  2015-10-10   98  	dev->dev_private = priv;
23e7b2ab9 Xinliang Liu  2015-10-09   99  	dev_set_drvdata(dev->dev, dev);
23e7b2ab9 Xinliang Liu  2015-10-09  100  
23e7b2ab9 Xinliang Liu  2015-10-09  101  	/* dev->mode_config initialization */
23e7b2ab9 Xinliang Liu  2015-10-09  102  	drm_mode_config_init(dev);
23e7b2ab9 Xinliang Liu  2015-10-09  103  	kirin_drm_mode_config_init(dev);
23e7b2ab9 Xinliang Liu  2015-10-09  104  
23e7b2ab9 Xinliang Liu  2015-10-09  105  	/* display controller init */
d25bcfb8c Daniel Vetter 2016-08-12 @106  	ret = dc_ops->init(to_platform_device(dev));
23e7b2ab9 Xinliang Liu  2015-10-09  107  	if (ret)
23e7b2ab9 Xinliang Liu  2015-10-09  108  		goto err_mode_config_cleanup;
23e7b2ab9 Xinliang Liu  2015-10-09  109  
23e7b2ab9 Xinliang Liu  2015-10-09  110  	/* bind and init sub drivers */
23e7b2ab9 Xinliang Liu  2015-10-09  111  	ret = component_bind_all(dev->dev, dev);
23e7b2ab9 Xinliang Liu  2015-10-09  112  	if (ret) {
23e7b2ab9 Xinliang Liu  2015-10-09  113  		DRM_ERROR("failed to bind all component.\n");
23e7b2ab9 Xinliang Liu  2015-10-09  114  		goto err_dc_cleanup;
23e7b2ab9 Xinliang Liu  2015-10-09  115  	}
23e7b2ab9 Xinliang Liu  2015-10-09  116  
bc4611e80 Xinliang Liu  2015-10-10  117  	/* vblank init */
bc4611e80 Xinliang Liu  2015-10-10  118  	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
bc4611e80 Xinliang Liu  2015-10-10  119  	if (ret) {
bc4611e80 Xinliang Liu  2015-10-10  120  		DRM_ERROR("failed to initialize vblank.\n");
bc4611e80 Xinliang Liu  2015-10-10  121  		goto err_unbind_all;
bc4611e80 Xinliang Liu  2015-10-10  122  	}
bc4611e80 Xinliang Liu  2015-10-10  123  	/* with irq_enabled = true, we can use the vblank feature. */
bc4611e80 Xinliang Liu  2015-10-10  124  	dev->irq_enabled = true;
bc4611e80 Xinliang Liu  2015-10-10  125  
23e7b2ab9 Xinliang Liu  2015-10-09  126  	/* reset all the states of crtc/plane/encoder/connector */
23e7b2ab9 Xinliang Liu  2015-10-09  127  	drm_mode_config_reset(dev);
23e7b2ab9 Xinliang Liu  2015-10-09  128  
6b7a59654 Xinliang Liu  2015-10-10  129  	/* init kms poll for handling hpd */
6b7a59654 Xinliang Liu  2015-10-10  130  	drm_kms_helper_poll_init(dev);
6b7a59654 Xinliang Liu  2015-10-10  131  
6b7a59654 Xinliang Liu  2015-10-10  132  	/* force detection after connectors init */
6b7a59654 Xinliang Liu  2015-10-10  133  	(void)drm_helper_hpd_irq_event(dev);
6b7a59654 Xinliang Liu  2015-10-10  134  
23e7b2ab9 Xinliang Liu  2015-10-09  135  	return 0;
23e7b2ab9 Xinliang Liu  2015-10-09  136  
bc4611e80 Xinliang Liu  2015-10-10  137  err_unbind_all:
bc4611e80 Xinliang Liu  2015-10-10  138  	component_unbind_all(dev->dev, dev);
23e7b2ab9 Xinliang Liu  2015-10-09  139  err_dc_cleanup:
23e7b2ab9 Xinliang Liu  2015-10-09 @140  	dc_ops->cleanup(dev);
23e7b2ab9 Xinliang Liu  2015-10-09  141  err_mode_config_cleanup:
23e7b2ab9 Xinliang Liu  2015-10-09  142  	drm_mode_config_cleanup(dev);
783ad972c Xinliang Liu  2015-10-10  143  	devm_kfree(dev->dev, priv);

:::::: The code at line 140 was first introduced by commit
:::::: 23e7b2ab9a8ff5653e8140248a494c3f3171dce3 drm/hisilicon: Add hisilicon kirin drm master driver

:::::: TO: Xinliang Liu <xinliang.liu at linaro.org>
:::::: CC: Xinliang Liu <xinliang.liu at linaro.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 51365 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20160817/01faa652/attachment-0001.obj>


More information about the Intel-gfx mailing list