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

usb: gadget: lpc32xx_udc: Convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

authored by

Qinglang Miao and committed by
Felipe Balbi
5bb1d119 0abe3863

+3 -14
+3 -14
drivers/usb/gadget/udc/lpc32xx_udc.c
··· 495 495 } 496 496 } 497 497 498 - static int proc_udc_show(struct seq_file *s, void *unused) 498 + static int udc_show(struct seq_file *s, void *unused) 499 499 { 500 500 struct lpc32xx_udc *udc = s->private; 501 501 struct lpc32xx_ep *ep; ··· 524 524 return 0; 525 525 } 526 526 527 - static int proc_udc_open(struct inode *inode, struct file *file) 528 - { 529 - return single_open(file, proc_udc_show, PDE_DATA(inode)); 530 - } 531 - 532 - static const struct file_operations proc_ops = { 533 - .owner = THIS_MODULE, 534 - .open = proc_udc_open, 535 - .read = seq_read, 536 - .llseek = seq_lseek, 537 - .release = single_release, 538 - }; 527 + DEFINE_SHOW_ATTRIBUTE(udc); 539 528 540 529 static void create_debug_file(struct lpc32xx_udc *udc) 541 530 { 542 - udc->pde = debugfs_create_file(debug_filename, 0, NULL, udc, &proc_ops); 531 + udc->pde = debugfs_create_file(debug_filename, 0, NULL, udc, &udc_fops); 543 532 } 544 533 545 534 static void remove_debug_file(struct lpc32xx_udc *udc)