USB: OHCI: prepare to make ohci-hcd a library module
A message that is not in the archive (sent off-list or not yet received): CAJFYCKGSctw1_nXoETYwyVkgAncHyBb8dmZ9aBV-av=8S0rw4A@mail.gmail.com
RFC PATCH 1/2 USB: OHCI: prepare to make ohci-hcd a library module
Quoted 28 lines · Manjunath Goudar
Quoted 28 lines
Review retry: · line 765
Quoted 5 lines
(quoted diff) +0
-0@@ -767,7 +762,37 @@ retry: return 0; }+/*------------------------------------------------------------------------*/
Review retry: · line 774
Quoted 9 lines
(quoted diff) +9
-0+ +/* ohci generic function for all OHCI bus glue */ + +static int ohci_setup(struct usb_hcd *hcd) +{ + struct ohci_hcd *ohci = hcd_to_ohci(hcd); + int retval; + + ohci->sbrn = HCD_USB11;What is this doing here? Why did you add this "sbrn" member to struct
ohci_hcd?not required so reverted.
Quoted 6 lines
(quoted diff) +6
-0+ + /* data structure init */ + retval = ohci_init(ohci); + if (retval) + return retval; + ohci_usb_reset(ohci);
Quoted 6 lines
Quoted 4 lines
Why is this call here? Doesn't
ohci_init()already callohci_usb_reset()?
ohci_initis not called inohci_usb_reset()its called inohci_restart()so I thinkohci_initneeded.
It sounds like you did not understand what I wrote.
ohci_setup does not need to call ohci_usb_reset. ohci_setup calls ohci_init, and ohci_init calls ohci_usb_reset.
Quoted 4 lines
Quoted 4 lines
The #else part of this isn't needed, and I doubt very much that it would work correctly if it was needed.
As Arnd suggestion,so I written else part.
The existing code doesn't have a #else part, and I don't think you need to add one.
Alan Stern
RFC PATCH 1/2 USB: OHCI: prepare to make ohci-hcd a library module
Quoted 7 lines · Alan Stern
Quoted 4 lines
Quoted 2 lines
The #else part of this isn't needed, and I doubt very much that it would work correctly if it was needed.
As Arnd suggestion,so I written else part.
The existing code doesn't have a #else part, and I don't think you need to add one.
I had commented in an earlier (Linaro internal) review that function declarations should not be hidden inside of an #ifdef unless there is an #else clause defining an alternative.
I did not want to suggest with that adding an #else for the fun of it, of course it should only be there if actually needed.
Arnd
RFC PATCH 1/2 USB: OHCI: prepare to make ohci-hcd a library module
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Alan Stern
Quoted 4 lines
Quoted 2 lines
The #else part of this isn't needed, and I doubt very much that it would work correctly if it was needed.
As Arnd suggestion,so I written else part.
The existing code doesn't have a #else part, and I don't think you need to add one.
Quoted 6 lines
I had commented in an earlier (Linaro internal) review that function declarations should not be hidden inside of an #ifdef unless there is an #else clause defining an alternative.
I did not want to suggest with that adding an #else for the fun of it, of course it should only be there if actually needed.
Well, empty inline function definitions don't have any runtime cost, so there's nothing really wrong with it. But it does give the impression that it's okay to try calling these routines when CONFIG_PM isn't enabled, which isn't true. Either the result won't be what you expected, or else you shouldn't be calling them in the first place.
Alan Stern
PS: If the proposed __pm annotation is added (see
http://marc.info/?l=linux-pm&m=136811978510598&w=2) then this whole discussion will become moot. :-)