[usb:usb-testing 50/55] drivers/platform/chrome/cros_typec_switch.c:93:9: error: call to undeclared function 'acpi_evaluate_integer'; ISO C99 and later do not support implicit function declarations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
head:   c76d09da77d69d7f737540985912ad2bca654713
commit: e54369058f3da181fcc4c893f224a0c5a8a526b6 [50/55] platform/chrome: cros_typec_switch: Add switch driver
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20220717/202207170614.2HHvAplN-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 07022e6cf9b5b3baa642be53d0b3c3f1c403dbfd)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?id=e54369058f3da181fcc4c893f224a0c5a8a526b6
        git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
        git fetch --no-tags usb usb-testing
        git checkout e54369058f3da181fcc4c893f224a0c5a8a526b6
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/block/ drivers/iio/light/ drivers/media/i2c/ drivers/net/pcs/ drivers/pinctrl/nuvoton/ drivers/platform/chrome/ drivers/spmi/ kernel/trace/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/platform/chrome/cros_typec_switch.c:93:9: error: call to undeclared function 'acpi_evaluate_integer'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                   ret = acpi_evaluate_integer(adev->handle, "_ADR", NULL, &index);
                         ^
   drivers/platform/chrome/cros_typec_switch.c:93:9: note: did you mean 'acpi_evaluate_object'?
   include/acpi/acpixf.h:550:8: note: 'acpi_evaluate_object' declared here
                               acpi_evaluate_object(acpi_handle object,
                               ^
   include/acpi/platform/aclinux.h:93:21: note: expanded from macro 'ACPI_EXTERNAL_RETURN_STATUS'
           static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
                              ^
>> drivers/platform/chrome/cros_typec_switch.c:93:35: error: incomplete definition of type 'struct acpi_device'
                   ret = acpi_evaluate_integer(adev->handle, "_ADR", NULL, &index);
                                               ~~~~^
   include/linux/acpi.h:790:8: note: forward declaration of 'struct acpi_device'
   struct acpi_device;
          ^
   2 errors generated.


vim +/acpi_evaluate_integer +93 drivers/platform/chrome/cros_typec_switch.c

    62	
    63	static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)
    64	{
    65		struct cros_typec_port *port = NULL;
    66		struct device *dev = sdata->dev;
    67		struct fwnode_handle *fwnode;
    68		struct acpi_device *adev;
    69		unsigned long long index;
    70		int ret = 0;
    71		int nports;
    72	
    73		nports = device_get_child_node_count(dev);
    74		if (nports == 0) {
    75			dev_err(dev, "No switch devices found.\n");
    76			return -ENODEV;
    77		}
    78	
    79		device_for_each_child_node(dev, fwnode) {
    80			port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
    81			if (!port) {
    82				ret = -ENOMEM;
    83				goto err_switch;
    84			}
    85	
    86			adev = to_acpi_device_node(fwnode);
    87			if (!adev) {
    88				dev_err(fwnode->dev, "Couldn't get ACPI device handle\n");
    89				ret = -ENODEV;
    90				goto err_switch;
    91			}
    92	
  > 93			ret = acpi_evaluate_integer(adev->handle, "_ADR", NULL, &index);
    94			if (ACPI_FAILURE(ret)) {
    95				dev_err(fwnode->dev, "_ADR wasn't evaluated\n");
    96				ret = -ENODATA;
    97				goto err_switch;
    98			}
    99	
   100			if (index < 0 || index >= EC_USB_PD_MAX_PORTS) {
   101				dev_err(fwnode->dev, "Invalid port index number: %llu", index);
   102				ret = -EINVAL;
   103				goto err_switch;
   104			}
   105			port->sdata = sdata;
   106			port->port_num = index;
   107			sdata->ports[index] = port;
   108	
   109			ret = cros_typec_register_retimer(port, fwnode);
   110			if (ret) {
   111				dev_err(dev, "Retimer switch register failed\n");
   112				goto err_switch;
   113			}
   114	
   115			dev_dbg(dev, "Retimer switch registered for index %llu\n", index);
   116		}
   117	
   118		return 0;
   119	err_switch:
   120		cros_typec_unregister_switches(sdata);
   121		return ret;
   122	}
   123	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux