usb: gadget: configfs: simplify os_desc_item_to_gadget_info() helper
authorLinyu Yuan <quic_linyyuan@quicinc.com>
Thu, 18 Nov 2021 04:53:30 +0000 (12:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Nov 2021 13:12:47 +0000 (14:12 +0100)
commit167a799c6e88b700c386a010ba3c77ebdbd21a8e
tree580a9e6c633283268d9bda2c2795384bece26cd5
parente4ac5a40cec2ac0dcc050262ec9d97a8efa06b0b
usb: gadget: configfs: simplify os_desc_item_to_gadget_info() helper

since os_desc_group is already a member of struct gadget_info,
we can simply just use container_of() to retrieve the latter,
without needing to dereference the cg_item's parent pointer.

use os_desc_item_to_gadget_info() helper in os_desc (un)link function.

Reviewed-by: Jack Pham <quic_jackp@quicinc.com>
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/1637211213-16400-2-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/configfs.c