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

USB: phy: fsl-usb: remove sysfs abuse

This file has a HUGE debugging sysfs file that spews out a lot of
information all at once, which violates the one-value-per-file rule for
sysfs. If this is really needed, it should go into debugfs, but given
the age of this driver, I strongly doubt anyone is using it anymore.

So just remove the file entirely, it was never documented, so obviously,
no one actually needed it :)

Cc: Felipe Balbi <balbi@kernel.org>
Reviewed-by: Ran Wang <ran.wang_1@nxp.com>
Link: https://lore.kernel.org/r/20200702072914.1072878-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-93
-93
drivers/usb/phy/phy-fsl-usb.c
··· 957 957 return 0; 958 958 } 959 959 960 - /* 961 - * state file in sysfs 962 - */ 963 - static ssize_t show_fsl_usb2_otg_state(struct device *dev, 964 - struct device_attribute *attr, char *buf) 965 - { 966 - struct otg_fsm *fsm = &fsl_otg_dev->fsm; 967 - char *next = buf; 968 - unsigned size = PAGE_SIZE; 969 - int t; 970 - 971 - mutex_lock(&fsm->lock); 972 - 973 - /* basic driver infomation */ 974 - t = scnprintf(next, size, 975 - DRIVER_DESC "\n" "fsl_usb2_otg version: %s\n\n", 976 - DRIVER_VERSION); 977 - size -= t; 978 - next += t; 979 - 980 - /* Registers */ 981 - t = scnprintf(next, size, 982 - "OTGSC: 0x%08x\n" 983 - "PORTSC: 0x%08x\n" 984 - "USBMODE: 0x%08x\n" 985 - "USBCMD: 0x%08x\n" 986 - "USBSTS: 0x%08x\n" 987 - "USBINTR: 0x%08x\n", 988 - fsl_readl(&usb_dr_regs->otgsc), 989 - fsl_readl(&usb_dr_regs->portsc), 990 - fsl_readl(&usb_dr_regs->usbmode), 991 - fsl_readl(&usb_dr_regs->usbcmd), 992 - fsl_readl(&usb_dr_regs->usbsts), 993 - fsl_readl(&usb_dr_regs->usbintr)); 994 - size -= t; 995 - next += t; 996 - 997 - /* State */ 998 - t = scnprintf(next, size, 999 - "OTG state: %s\n\n", 1000 - usb_otg_state_string(fsl_otg_dev->phy.otg->state)); 1001 - size -= t; 1002 - next += t; 1003 - 1004 - /* State Machine Variables */ 1005 - t = scnprintf(next, size, 1006 - "a_bus_req: %d\n" 1007 - "b_bus_req: %d\n" 1008 - "a_bus_resume: %d\n" 1009 - "a_bus_suspend: %d\n" 1010 - "a_conn: %d\n" 1011 - "a_sess_vld: %d\n" 1012 - "a_srp_det: %d\n" 1013 - "a_vbus_vld: %d\n" 1014 - "b_bus_resume: %d\n" 1015 - "b_bus_suspend: %d\n" 1016 - "b_conn: %d\n" 1017 - "b_se0_srp: %d\n" 1018 - "b_ssend_srp: %d\n" 1019 - "b_sess_vld: %d\n" 1020 - "id: %d\n", 1021 - fsm->a_bus_req, 1022 - fsm->b_bus_req, 1023 - fsm->a_bus_resume, 1024 - fsm->a_bus_suspend, 1025 - fsm->a_conn, 1026 - fsm->a_sess_vld, 1027 - fsm->a_srp_det, 1028 - fsm->a_vbus_vld, 1029 - fsm->b_bus_resume, 1030 - fsm->b_bus_suspend, 1031 - fsm->b_conn, 1032 - fsm->b_se0_srp, 1033 - fsm->b_ssend_srp, 1034 - fsm->b_sess_vld, 1035 - fsm->id); 1036 - size -= t; 1037 - next += t; 1038 - 1039 - mutex_unlock(&fsm->lock); 1040 - 1041 - return PAGE_SIZE - size; 1042 - } 1043 - 1044 - static DEVICE_ATTR(fsl_usb2_otg_state, S_IRUGO, show_fsl_usb2_otg_state, NULL); 1045 - 1046 - static struct attribute *fsl_otg_attrs[] = { 1047 - &dev_attr_fsl_usb2_otg_state.attr, 1048 - NULL, 1049 - }; 1050 - ATTRIBUTE_GROUPS(fsl_otg); 1051 - 1052 960 /* Char driver interface to control some OTG input */ 1053 961 1054 962 /* ··· 1075 1167 .driver = { 1076 1168 .name = driver_name, 1077 1169 .owner = THIS_MODULE, 1078 - .dev_groups = fsl_otg_groups, 1079 1170 }, 1080 1171 }; 1081 1172