[usb:usb-testing 155/155] drivers/platform/chrome/cros_ec_typec.c:778:8: error: 'CABLE_ATYPE' undeclared; did you mean

[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:   0e1d6f55a12e47942ce207dfb93e23049b454c9e
commit: 0e1d6f55a12e47942ce207dfb93e23049b454c9e [155/155] usb: pd: Update VDO definitions
config: arm-randconfig-r005-20210202 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
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=0e1d6f55a12e47942ce207dfb93e23049b454c9e
        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 0e1d6f55a12e47942ce207dfb93e23049b454c9e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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

All errors (new ones prefixed by >>):

   drivers/platform/chrome/cros_ec_typec.c: In function 'cros_typec_handle_sop_prime_disc':
>> drivers/platform/chrome/cros_ec_typec.c:778:8: error: 'CABLE_ATYPE' undeclared (first use in this function); did you mean 'CABLE_CTYPE'?
     778 |   case CABLE_ATYPE:
         |        ^~~~~~~~~~~
         |        CABLE_CTYPE
   drivers/platform/chrome/cros_ec_typec.c:778:8: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/platform/chrome/cros_ec_typec.c:781:8: error: 'CABLE_BTYPE' undeclared (first use in this function); did you mean 'CABLE_CTYPE'?
     781 |   case CABLE_BTYPE:
         |        ^~~~~~~~~~~
         |        CABLE_CTYPE


vim +778 drivers/platform/chrome/cros_ec_typec.c

8fab2755191f86 Prashant Malani 2020-11-16  750  
3b3dd1f0dbfe92 Benson Leung    2021-01-28  751  static int cros_typec_handle_sop_prime_disc(struct cros_typec_data *typec, int port_num, u16 pd_revision)
8b46a212ad11f2 Prashant Malani 2020-11-16  752  {
8b46a212ad11f2 Prashant Malani 2020-11-16  753  	struct cros_typec_port *port = typec->ports[port_num];
8b46a212ad11f2 Prashant Malani 2020-11-16  754  	struct ec_response_typec_discovery *disc = port->disc_data;
f4edab68e10119 Prashant Malani 2020-11-16  755  	struct typec_cable_desc c_desc = {};
f4edab68e10119 Prashant Malani 2020-11-16  756  	struct typec_plug_desc p_desc;
8b46a212ad11f2 Prashant Malani 2020-11-16  757  	struct ec_params_typec_discovery req = {
8b46a212ad11f2 Prashant Malani 2020-11-16  758  		.port = port_num,
8b46a212ad11f2 Prashant Malani 2020-11-16  759  		.partner_type = TYPEC_PARTNER_SOP_PRIME,
8b46a212ad11f2 Prashant Malani 2020-11-16  760  	};
72d6e32bd85bd1 Prashant Malani 2020-11-16  761  	u32 cable_plug_type;
8b46a212ad11f2 Prashant Malani 2020-11-16  762  	int ret = 0;
8b46a212ad11f2 Prashant Malani 2020-11-16  763  
8b46a212ad11f2 Prashant Malani 2020-11-16  764  	memset(disc, 0, EC_PROTO2_MAX_RESPONSE_SIZE);
8b46a212ad11f2 Prashant Malani 2020-11-16  765  	ret = cros_typec_ec_command(typec, 0, EC_CMD_TYPEC_DISCOVERY, &req, sizeof(req),
8b46a212ad11f2 Prashant Malani 2020-11-16  766  				    disc, EC_PROTO2_MAX_RESPONSE_SIZE);
8b46a212ad11f2 Prashant Malani 2020-11-16  767  	if (ret < 0) {
8b46a212ad11f2 Prashant Malani 2020-11-16  768  		dev_err(typec->dev, "Failed to get SOP' discovery data for port: %d\n", port_num);
8b46a212ad11f2 Prashant Malani 2020-11-16  769  		goto sop_prime_disc_exit;
8b46a212ad11f2 Prashant Malani 2020-11-16  770  	}
8b46a212ad11f2 Prashant Malani 2020-11-16  771  
8b46a212ad11f2 Prashant Malani 2020-11-16  772  	/* Parse the PD identity data, even if only 0s were returned. */
8b46a212ad11f2 Prashant Malani 2020-11-16  773  	cros_typec_parse_pd_identity(&port->c_identity, disc);
8b46a212ad11f2 Prashant Malani 2020-11-16  774  
72d6e32bd85bd1 Prashant Malani 2020-11-16  775  	if (disc->identity_count != 0) {
72d6e32bd85bd1 Prashant Malani 2020-11-16  776  		cable_plug_type = VDO_TYPEC_CABLE_TYPE(port->c_identity.vdo[0]);
72d6e32bd85bd1 Prashant Malani 2020-11-16  777  		switch (cable_plug_type) {
72d6e32bd85bd1 Prashant Malani 2020-11-16 @778  		case CABLE_ATYPE:
f4edab68e10119 Prashant Malani 2020-11-16  779  			c_desc.type = USB_PLUG_TYPE_A;
72d6e32bd85bd1 Prashant Malani 2020-11-16  780  			break;
72d6e32bd85bd1 Prashant Malani 2020-11-16 @781  		case CABLE_BTYPE:
f4edab68e10119 Prashant Malani 2020-11-16  782  			c_desc.type = USB_PLUG_TYPE_B;
72d6e32bd85bd1 Prashant Malani 2020-11-16  783  			break;
72d6e32bd85bd1 Prashant Malani 2020-11-16  784  		case CABLE_CTYPE:
f4edab68e10119 Prashant Malani 2020-11-16  785  			c_desc.type = USB_PLUG_TYPE_C;
72d6e32bd85bd1 Prashant Malani 2020-11-16  786  			break;
72d6e32bd85bd1 Prashant Malani 2020-11-16  787  		case CABLE_CAPTIVE:
f4edab68e10119 Prashant Malani 2020-11-16  788  			c_desc.type = USB_PLUG_CAPTIVE;
72d6e32bd85bd1 Prashant Malani 2020-11-16  789  			break;
72d6e32bd85bd1 Prashant Malani 2020-11-16  790  		default:
f4edab68e10119 Prashant Malani 2020-11-16  791  			c_desc.type = USB_PLUG_NONE;
72d6e32bd85bd1 Prashant Malani 2020-11-16  792  		}
f4edab68e10119 Prashant Malani 2020-11-16  793  		c_desc.active = PD_IDH_PTYPE(port->c_identity.id_header) == IDH_PTYPE_ACABLE;
72d6e32bd85bd1 Prashant Malani 2020-11-16  794  	}
8b46a212ad11f2 Prashant Malani 2020-11-16  795  
f4edab68e10119 Prashant Malani 2020-11-16  796  	c_desc.identity = &port->c_identity;
3b3dd1f0dbfe92 Benson Leung    2021-01-28  797  	c_desc.pd_revision = pd_revision;
8b46a212ad11f2 Prashant Malani 2020-11-16  798  
f4edab68e10119 Prashant Malani 2020-11-16  799  	port->cable = typec_register_cable(port->port, &c_desc);
8b46a212ad11f2 Prashant Malani 2020-11-16  800  	if (IS_ERR(port->cable)) {
8b46a212ad11f2 Prashant Malani 2020-11-16  801  		ret = PTR_ERR(port->cable);
8b46a212ad11f2 Prashant Malani 2020-11-16  802  		port->cable = NULL;
f4edab68e10119 Prashant Malani 2020-11-16  803  		goto sop_prime_disc_exit;
f4edab68e10119 Prashant Malani 2020-11-16  804  	}
f4edab68e10119 Prashant Malani 2020-11-16  805  
f4edab68e10119 Prashant Malani 2020-11-16  806  	p_desc.index = TYPEC_PLUG_SOP_P;
f4edab68e10119 Prashant Malani 2020-11-16  807  	port->plug = typec_register_plug(port->cable, &p_desc);
f4edab68e10119 Prashant Malani 2020-11-16  808  	if (IS_ERR(port->plug)) {
f4edab68e10119 Prashant Malani 2020-11-16  809  		ret = PTR_ERR(port->plug);
f4edab68e10119 Prashant Malani 2020-11-16  810  		port->plug = NULL;
f4edab68e10119 Prashant Malani 2020-11-16  811  		goto sop_prime_disc_exit;
8b46a212ad11f2 Prashant Malani 2020-11-16  812  	}
8b46a212ad11f2 Prashant Malani 2020-11-16  813  
1563090965421f Prashant Malani 2020-11-16  814  	ret = cros_typec_register_altmodes(typec, port_num, false);
1563090965421f Prashant Malani 2020-11-16  815  	if (ret < 0) {
1563090965421f Prashant Malani 2020-11-16  816  		dev_err(typec->dev, "Failed to register plug altmodes, port: %d\n", port_num);
1563090965421f Prashant Malani 2020-11-16  817  		goto sop_prime_disc_exit;
1563090965421f Prashant Malani 2020-11-16  818  	}
1563090965421f Prashant Malani 2020-11-16  819  
f4edab68e10119 Prashant Malani 2020-11-16  820  	return 0;
f4edab68e10119 Prashant Malani 2020-11-16  821  
8b46a212ad11f2 Prashant Malani 2020-11-16  822  sop_prime_disc_exit:
f4edab68e10119 Prashant Malani 2020-11-16  823  	cros_typec_remove_cable(typec, port_num);
8b46a212ad11f2 Prashant Malani 2020-11-16  824  	return ret;
8b46a212ad11f2 Prashant Malani 2020-11-16  825  }
8b46a212ad11f2 Prashant Malani 2020-11-16  826  

:::::: The code at line 778 was first introduced by commit
:::::: 72d6e32bd85bd1e5cb5aa467f4eb5d0a69559953 platform/chrome: cros_ec_typec: Store cable plug type

:::::: TO: Prashant Malani <pmalani@xxxxxxxxxxxx>
:::::: CC: Benson Leung <bleung@xxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


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

  Powered by Linux