* [PATCH v3] usb: dwc3: gadget: clear gadget pointer after exit
@ 2021-09-09 11:12 Linyu Yuan
2021-09-09 11:20 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Linyu Yuan @ 2021-09-09 11:12 UTC (permalink / raw)
To: Felipe Balbi, Greg Kroah-Hartman; +Cc: linux-usb, Linyu Yuan
change device release function to clear gadget pointer,
it is just a cleanup change.
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
v2: fix comment from Greg Kroah-Hartman and improve commit log
v3: change commit log, it is just a cleanup change
drivers/usb/dwc3/gadget.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 804b505..e2ab5f6 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -4188,9 +4188,10 @@ static int dwc3_gadget_get_irq(struct dwc3 *dwc)
static void dwc_gadget_release(struct device *dev)
{
- struct usb_gadget *gadget = container_of(dev, struct usb_gadget, dev);
+ struct dwc3 *dwc = dev_get_platdata(dev);
- kfree(gadget);
+ kfree(dwc->gadget);
+ dwc->gadget = NULL;
}
/**
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] usb: dwc3: gadget: clear gadget pointer after exit
2021-09-09 11:12 [PATCH v3] usb: dwc3: gadget: clear gadget pointer after exit Linyu Yuan
@ 2021-09-09 11:20 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2021-09-09 11:20 UTC (permalink / raw)
To: Linyu Yuan; +Cc: Felipe Balbi, linux-usb
On Thu, Sep 09, 2021 at 07:12:43PM +0800, Linyu Yuan wrote:
> change device release function to clear gadget pointer,
> it is just a cleanup change.
>
> Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
> ---
> v2: fix comment from Greg Kroah-Hartman and improve commit log
> v3: change commit log, it is just a cleanup change
>
> drivers/usb/dwc3/gadget.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 804b505..e2ab5f6 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -4188,9 +4188,10 @@ static int dwc3_gadget_get_irq(struct dwc3 *dwc)
>
> static void dwc_gadget_release(struct device *dev)
> {
> - struct usb_gadget *gadget = container_of(dev, struct usb_gadget, dev);
> + struct dwc3 *dwc = dev_get_platdata(dev);
>
> - kfree(gadget);
> + kfree(dwc->gadget);
> + dwc->gadget = NULL;
> }
>
> /**
> --
> 2.7.4
>
This does not do any functional change, and is not a "cleanup" at all.
If you have code that requires this, wonderful, please submit that as
well, but we can not take changes that do not have in-tree users,
otherwise we could never maintain the kernel at all. Make this a patch
series with your usage as well.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-09 11:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 11:12 [PATCH v3] usb: dwc3: gadget: clear gadget pointer after exit Linyu Yuan
2021-09-09 11:20 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.