Skip to content

Commit 6b120ef

Browse files
stonezdmgregkh
authored andcommitted
usb: typec: ucsi: fix probe failure in gaokun_ucsi_probe()
The gaokun_ucsi_probe() uses ucsi_create() to allocate a UCSI instance. The ucsi_create() validates whether ops->poll_cci is defined, and if not, it directly returns -EINVAL. However, the gaokun_ucsi_ops structure does not define the poll_cci, causing ucsi_create() always fail with -EINVAL. This issue can be observed in the kernel log with the following error: ucsi_huawei_gaokun.ucsi huawei_gaokun_ec.ucsi.0: probe with driver ucsi_huawei_gaokun.ucsi failed with error -22 Fix the issue by adding the missing poll_cci callback to gaokun_ucsi_ops. Fixes: 00327d7 ("usb: typec: ucsi: add Huawei Matebook E Go ucsi driver") Cc: stable <stable@kernel.org> Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Pengyu Luo <mitltlatltl@gmail.com> Link: https://patch.msgid.link/4d077d6439d728be68646bb8c8678436a3a0885e.1764065838.git.duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6d935ce commit 6b120ef

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/usb/typec/ucsi/ucsi_huawei_gaokun.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ static void gaokun_ucsi_connector_status(struct ucsi_connector *con)
196196
const struct ucsi_operations gaokun_ucsi_ops = {
197197
.read_version = gaokun_ucsi_read_version,
198198
.read_cci = gaokun_ucsi_read_cci,
199+
.poll_cci = gaokun_ucsi_read_cci,
199200
.read_message_in = gaokun_ucsi_read_message_in,
200201
.sync_control = ucsi_sync_control_common,
201202
.async_control = gaokun_ucsi_async_control,

0 commit comments

Comments
 (0)