Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "usb: typec: ucsi: Enable debugfs for message_out data structure"

This reverts commit 775fae520e6ae62c393a8daf42dc534f09692f3f.

The new buffer management code that this relies on is broken so revert
for now.

It also looks like the error handling needs some more thought as the
message out size is not reset on errors.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20251222152204.2846-3-johan@kernel.org

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
174e7d0f 784b756d

-26
-26
drivers/usb/typec/ucsi/debugfs.c
··· 110 110 } 111 111 DEFINE_SHOW_ATTRIBUTE(ucsi_vbus_volt); 112 112 113 - static ssize_t ucsi_message_out_write(struct file *file, 114 - const char __user *data, size_t count, loff_t *ppos) 115 - { 116 - struct ucsi *ucsi = file->private_data; 117 - int ret; 118 - 119 - char *buf __free(kfree) = memdup_user_nul(data, count); 120 - if (IS_ERR(buf)) 121 - return PTR_ERR(buf); 122 - 123 - ucsi->message_out_size = min(count / 2, UCSI_MAX_MESSAGE_OUT_LENGTH); 124 - ret = hex2bin(ucsi->message_out, buf, ucsi->message_out_size); 125 - if (ret) 126 - return ret; 127 - 128 - return count; 129 - } 130 - 131 - static const struct file_operations ucsi_message_out_fops = { 132 - .open = simple_open, 133 - .write = ucsi_message_out_write, 134 - .llseek = generic_file_llseek, 135 - }; 136 - 137 113 void ucsi_debugfs_register(struct ucsi *ucsi) 138 114 { 139 115 ucsi->debugfs = kzalloc(sizeof(*ucsi->debugfs), GFP_KERNEL); ··· 122 146 debugfs_create_file("peak_current", 0400, ucsi->debugfs->dentry, ucsi, &ucsi_peak_curr_fops); 123 147 debugfs_create_file("avg_current", 0400, ucsi->debugfs->dentry, ucsi, &ucsi_avg_curr_fops); 124 148 debugfs_create_file("vbus_voltage", 0400, ucsi->debugfs->dentry, ucsi, &ucsi_vbus_volt_fops); 125 - debugfs_create_file("message_out", 0200, ucsi->debugfs->dentry, ucsi, 126 - &ucsi_message_out_fops); 127 149 } 128 150 129 151 void ucsi_debugfs_unregister(struct ucsi *ucsi)