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

USB: phy: fsl-usb: remove character device usage

No idea why this driver is using a char device node, statically
allocated, with no dynamic allocation or hook up with devtmpfs, along
with a reserverd major number, for "special" operations, not all of
which ever were implemented.

So just rip it out, as no one must be using it because no modern system
will ever actually create the /dev/ node it needs.

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

-83
-69
drivers/usb/phy/phy-fsl-usb.c
··· 957 957 return 0; 958 958 } 959 959 960 - /* Char driver interface to control some OTG input */ 961 - 962 - /* 963 - * Handle some ioctl command, such as get otg 964 - * status and set host suspend 965 - */ 966 - static long fsl_otg_ioctl(struct file *file, unsigned int cmd, 967 - unsigned long arg) 968 - { 969 - u32 retval = 0; 970 - 971 - switch (cmd) { 972 - case GET_OTG_STATUS: 973 - retval = fsl_otg_dev->host_working; 974 - break; 975 - 976 - case SET_A_SUSPEND_REQ: 977 - fsl_otg_dev->fsm.a_suspend_req_inf = arg; 978 - break; 979 - 980 - case SET_A_BUS_DROP: 981 - fsl_otg_dev->fsm.a_bus_drop = arg; 982 - break; 983 - 984 - case SET_A_BUS_REQ: 985 - fsl_otg_dev->fsm.a_bus_req = arg; 986 - break; 987 - 988 - case SET_B_BUS_REQ: 989 - fsl_otg_dev->fsm.b_bus_req = arg; 990 - break; 991 - 992 - default: 993 - break; 994 - } 995 - 996 - otg_statemachine(&fsl_otg_dev->fsm); 997 - 998 - return retval; 999 - } 1000 - 1001 - static int fsl_otg_open(struct inode *inode, struct file *file) 1002 - { 1003 - return 0; 1004 - } 1005 - 1006 - static int fsl_otg_release(struct inode *inode, struct file *file) 1007 - { 1008 - return 0; 1009 - } 1010 - 1011 - static const struct file_operations otg_fops = { 1012 - .owner = THIS_MODULE, 1013 - .llseek = NULL, 1014 - .read = NULL, 1015 - .write = NULL, 1016 - .unlocked_ioctl = fsl_otg_ioctl, 1017 - .open = fsl_otg_open, 1018 - .release = fsl_otg_release, 1019 - }; 1020 - 1021 960 static int fsl_otg_probe(struct platform_device *pdev) 1022 961 { 1023 962 int ret; ··· 978 1039 return ret; 979 1040 } 980 1041 981 - ret = register_chrdev(FSL_OTG_MAJOR, FSL_OTG_NAME, &otg_fops); 982 - if (ret) { 983 - dev_err(&pdev->dev, "unable to register FSL OTG device\n"); 984 - return ret; 985 - } 986 - 987 1042 return ret; 988 1043 } 989 1044 ··· 993 1060 fsl_otg_uninit_timers(); 994 1061 kfree(fsl_otg_dev->phy.otg); 995 1062 kfree(fsl_otg_dev); 996 - 997 - unregister_chrdev(FSL_OTG_MAJOR, FSL_OTG_NAME); 998 1063 999 1064 if (pdata->exit) 1000 1065 pdata->exit(pdev);
-14
drivers/usb/phy/phy-fsl-usb.h
··· 371 371 u8 otg_port; 372 372 }; 373 373 374 - /* For SRP and HNP handle */ 375 - #define FSL_OTG_MAJOR 240 376 374 #define FSL_OTG_NAME "fsl-usb2-otg" 377 - /* Command to OTG driver ioctl */ 378 - #define OTG_IOCTL_MAGIC FSL_OTG_MAJOR 379 - /* if otg work as host, it should return 1, otherwise return 0 */ 380 - #define GET_OTG_STATUS _IOR(OTG_IOCTL_MAGIC, 1, int) 381 - #define SET_A_SUSPEND_REQ _IOW(OTG_IOCTL_MAGIC, 2, int) 382 - #define SET_A_BUS_DROP _IOW(OTG_IOCTL_MAGIC, 3, int) 383 - #define SET_A_BUS_REQ _IOW(OTG_IOCTL_MAGIC, 4, int) 384 - #define SET_B_BUS_REQ _IOW(OTG_IOCTL_MAGIC, 5, int) 385 - #define GET_A_SUSPEND_REQ _IOR(OTG_IOCTL_MAGIC, 6, int) 386 - #define GET_A_BUS_DROP _IOR(OTG_IOCTL_MAGIC, 7, int) 387 - #define GET_A_BUS_REQ _IOR(OTG_IOCTL_MAGIC, 8, int) 388 - #define GET_B_BUS_REQ _IOR(OTG_IOCTL_MAGIC, 9, int) 389 375 390 376 void fsl_otg_add_timer(struct otg_fsm *fsm, void *timer); 391 377 void fsl_otg_del_timer(struct otg_fsm *fsm, void *timer);