[usb:usb-testing 32/33] drivers/usb/typec/ucsi/ucsi.c:890:12: error: conflicting types for 'ucsi_register_port'

[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:   f6402eb4a2b3192bdf23fa39ef8e85fd3691cca9
commit: 992a60ed0d5e312ce9a485c9e12097ac82ae4b3e [32/33] usb: typec: ucsi: register with power_supply class
config: riscv-randconfig-a001-20200427 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 992a60ed0d5e312ce9a485c9e12097ac82ae4b3e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=riscv 

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

All errors (new ones prefixed by >>):

>> drivers/usb/typec/ucsi/ucsi.c:890:12: error: conflicting types for 'ucsi_register_port'
     890 | static int ucsi_register_port(struct ucsi *ucsi, int index)
         |            ^~~~~~~~~~~~~~~~~~
   In file included from drivers/usb/typec/ucsi/ucsi.c:17:
   drivers/usb/typec/ucsi/ucsi.h:344:19: note: previous definition of 'ucsi_register_port' was here
     344 | static inline int ucsi_register_port(struct ucsi_connector *con) { return 0; }
         |                   ^~~~~~~~~~~~~~~~~~
   drivers/usb/typec/ucsi/ucsi.c: In function 'ucsi_register_port':
>> drivers/usb/typec/ucsi/ucsi.c:939:8: error: implicit declaration of function 'ucsi_register_port_psy'; did you mean 'ucsi_unregister_port_psy'? [-Werror=implicit-function-declaration]
     939 |  ret = ucsi_register_port_psy(con);
         |        ^~~~~~~~~~~~~~~~~~~~~~
         |        ucsi_unregister_port_psy
   cc1: some warnings being treated as errors

vim +/ucsi_register_port +890 drivers/usb/typec/ucsi/ucsi.c

c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  889  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16 @890  static int ucsi_register_port(struct ucsi *ucsi, int index)
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  891  {
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  892  	struct ucsi_connector *con = &ucsi->connector[index];
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  893  	struct typec_capability *cap = &con->typec_cap;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  894  	enum typec_accessory *accessory = cap->accessory;
470ce43a1a8101 Heikki Krogerus 2019-11-04  895  	u64 command;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  896  	int ret;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  897  
bdc62f2bae8fb0 Heikki Krogerus 2019-11-04  898  	INIT_WORK(&con->work, ucsi_handle_connector_change);
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  899  	init_completion(&con->complete);
ad74b8649beaf1 Heikki Krogerus 2019-04-23  900  	mutex_init(&con->lock);
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  901  	con->num = index + 1;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  902  	con->ucsi = ucsi;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  903  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  904  	/* Get connector capability */
470ce43a1a8101 Heikki Krogerus 2019-11-04  905  	command = UCSI_GET_CONNECTOR_CAPABILITY;
470ce43a1a8101 Heikki Krogerus 2019-11-04  906  	command |= UCSI_CONNECTOR_NUMBER(con->num);
470ce43a1a8101 Heikki Krogerus 2019-11-04  907  	ret = ucsi_run_command(ucsi, command, &con->cap, sizeof(con->cap));
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  908  	if (ret < 0)
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  909  		return ret;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  910  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  911  	if (con->cap.op_mode & UCSI_CONCAP_OPMODE_DRP)
ceeb162500c348 Heikki Krogerus 2018-03-20  912  		cap->data = TYPEC_PORT_DRD;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  913  	else if (con->cap.op_mode & UCSI_CONCAP_OPMODE_DFP)
ceeb162500c348 Heikki Krogerus 2018-03-20  914  		cap->data = TYPEC_PORT_DFP;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  915  	else if (con->cap.op_mode & UCSI_CONCAP_OPMODE_UFP)
ceeb162500c348 Heikki Krogerus 2018-03-20  916  		cap->data = TYPEC_PORT_UFP;
ceeb162500c348 Heikki Krogerus 2018-03-20  917  
3cf657f07918bc Heikki Krogerus 2019-11-04  918  	if ((con->cap.flags & UCSI_CONCAP_FLAG_PROVIDER) &&
3cf657f07918bc Heikki Krogerus 2019-11-04  919  	    (con->cap.flags & UCSI_CONCAP_FLAG_CONSUMER))
ceeb162500c348 Heikki Krogerus 2018-03-20  920  		cap->type = TYPEC_PORT_DRP;
3cf657f07918bc Heikki Krogerus 2019-11-04  921  	else if (con->cap.flags & UCSI_CONCAP_FLAG_PROVIDER)
ceeb162500c348 Heikki Krogerus 2018-03-20  922  		cap->type = TYPEC_PORT_SRC;
3cf657f07918bc Heikki Krogerus 2019-11-04  923  	else if (con->cap.flags & UCSI_CONCAP_FLAG_CONSUMER)
ceeb162500c348 Heikki Krogerus 2018-03-20  924  		cap->type = TYPEC_PORT_SNK;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  925  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  926  	cap->revision = ucsi->cap.typec_version;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  927  	cap->pd_revision = ucsi->cap.pd_version;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  928  	cap->prefer_role = TYPEC_NO_PREFERRED_ROLE;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  929  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  930  	if (con->cap.op_mode & UCSI_CONCAP_OPMODE_AUDIO_ACCESSORY)
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  931  		*accessory++ = TYPEC_ACCESSORY_AUDIO;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  932  	if (con->cap.op_mode & UCSI_CONCAP_OPMODE_DEBUG_ACCESSORY)
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  933  		*accessory = TYPEC_ACCESSORY_DEBUG;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  934  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  935  	cap->fwnode = ucsi_find_fwnode(con);
6df475f804e628 Heikki Krogerus 2019-11-04  936  	cap->driver_data = con;
6df475f804e628 Heikki Krogerus 2019-11-04  937  	cap->ops = &ucsi_ops;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  938  
992a60ed0d5e31 K V, Abhilash   2020-04-23 @939  	ret = ucsi_register_port_psy(con);
992a60ed0d5e31 K V, Abhilash   2020-04-23  940  	if (ret)
992a60ed0d5e31 K V, Abhilash   2020-04-23  941  		return ret;
992a60ed0d5e31 K V, Abhilash   2020-04-23  942  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  943  	/* Register the connector */
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  944  	con->port = typec_register_port(ucsi->dev, cap);
cf6e06cddf2972 Heikki Krogerus 2018-03-02  945  	if (IS_ERR(con->port))
cf6e06cddf2972 Heikki Krogerus 2018-03-02  946  		return PTR_ERR(con->port);
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  947  
ad74b8649beaf1 Heikki Krogerus 2019-04-23  948  	/* Alternate modes */
ad74b8649beaf1 Heikki Krogerus 2019-04-23  949  	ret = ucsi_register_altmodes(con, UCSI_RECIPIENT_CON);
ad74b8649beaf1 Heikki Krogerus 2019-04-23  950  	if (ret)
ad74b8649beaf1 Heikki Krogerus 2019-04-23  951  		dev_err(ucsi->dev, "con%d: failed to register alt modes\n",
ad74b8649beaf1 Heikki Krogerus 2019-04-23  952  			con->num);
ad74b8649beaf1 Heikki Krogerus 2019-04-23  953  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  954  	/* Get the status */
470ce43a1a8101 Heikki Krogerus 2019-11-04  955  	command = UCSI_GET_CONNECTOR_STATUS | UCSI_CONNECTOR_NUMBER(con->num);
470ce43a1a8101 Heikki Krogerus 2019-11-04  956  	ret = ucsi_run_command(ucsi, command, &con->status,
470ce43a1a8101 Heikki Krogerus 2019-11-04  957  			       sizeof(con->status));
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  958  	if (ret < 0) {
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  959  		dev_err(ucsi->dev, "con%d: failed to get status\n", con->num);
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  960  		return 0;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  961  	}
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  962  
3cf657f07918bc Heikki Krogerus 2019-11-04  963  	switch (UCSI_CONSTAT_PARTNER_TYPE(con->status.flags)) {
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  964  	case UCSI_CONSTAT_PARTNER_TYPE_UFP:
91813ef8da12fa Mayank Rana     2020-04-23  965  	case UCSI_CONSTAT_PARTNER_TYPE_CABLE:
91813ef8da12fa Mayank Rana     2020-04-23  966  	case UCSI_CONSTAT_PARTNER_TYPE_CABLE_AND_UFP:
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  967  		typec_set_data_role(con->port, TYPEC_HOST);
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  968  		break;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  969  	case UCSI_CONSTAT_PARTNER_TYPE_DFP:
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  970  		typec_set_data_role(con->port, TYPEC_DEVICE);
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  971  		break;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  972  	default:
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  973  		break;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  974  	}
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  975  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  976  	/* Check if there is already something connected */
3cf657f07918bc Heikki Krogerus 2019-11-04  977  	if (con->status.flags & UCSI_CONSTAT_CONNECTED) {
3cf657f07918bc Heikki Krogerus 2019-11-04  978  		typec_set_pwr_role(con->port,
3cf657f07918bc Heikki Krogerus 2019-11-04  979  				  !!(con->status.flags & UCSI_CONSTAT_PWR_DIR));
3cf657f07918bc Heikki Krogerus 2019-11-04  980  		ucsi_pwr_opmode_change(con);
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  981  		ucsi_register_partner(con);
3cf657f07918bc Heikki Krogerus 2019-11-04  982  	}
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  983  
ad74b8649beaf1 Heikki Krogerus 2019-04-23  984  	if (con->partner) {
ad74b8649beaf1 Heikki Krogerus 2019-04-23  985  		ret = ucsi_register_altmodes(con, UCSI_RECIPIENT_SOP);
ad74b8649beaf1 Heikki Krogerus 2019-04-23  986  		if (ret)
ad74b8649beaf1 Heikki Krogerus 2019-04-23  987  			dev_err(ucsi->dev,
ad74b8649beaf1 Heikki Krogerus 2019-04-23  988  				"con%d: failed to register alternate modes\n",
ad74b8649beaf1 Heikki Krogerus 2019-04-23  989  				con->num);
ad74b8649beaf1 Heikki Krogerus 2019-04-23  990  		else
ad74b8649beaf1 Heikki Krogerus 2019-04-23  991  			ucsi_altmode_update_active(con);
ad74b8649beaf1 Heikki Krogerus 2019-04-23  992  	}
ad74b8649beaf1 Heikki Krogerus 2019-04-23  993  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  994  	trace_ucsi_register_port(con->num, &con->status);
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  995  
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  996  	return 0;
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  997  }
c1b0bc2dabfa88 Heikki Krogerus 2017-06-16  998  

:::::: The code at line 890 was first introduced by commit
:::::: c1b0bc2dabfa884dea49c02adaf3cd6b52b33d2f usb: typec: Add support for UCSI interface

:::::: TO: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
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