Re: [RFC v0 3/8] firmware: Factor out firmware load helpers

2016-07-28 Thread Daniel Wagner
On 07/28/2016 07:57 PM, Dmitry Torokhov wrote: On Thu, Jul 28, 2016 at 09:55:07AM +0200, Daniel Wagner wrote: +int __firmware_stat_wait(struct firmware_stat *fwst, + long timeout) +{ + int err; + err = swait_event_interruptible_timeout(fwst->wq, +

Re: [RFC v0 3/8] firmware: Factor out firmware load helpers

2016-07-28 Thread Daniel Wagner
It's somewhat odd to me that the structure is "firmware_stat" but most of the functions are "fw_loading_*". That seems inconsistent for a structure that is (currently) only used by these functions. I agree, my proposal is odd. I would personally do either: a) "struct fw_load_status" and "fw_

Re: [RFC v0 3/8] firmware: Factor out firmware load helpers

2016-07-28 Thread Dmitry Torokhov
On Thu, Jul 28, 2016 at 09:55:07AM +0200, Daniel Wagner wrote: > +int __firmware_stat_wait(struct firmware_stat *fwst, > + long timeout) > +{ > + int err; > + err = swait_event_interruptible_timeout(fwst->wq, > + is_fw_sync_done(READ_O

Re: [RFC v0 3/8] firmware: Factor out firmware load helpers

2016-07-28 Thread Dan Williams
On Thu, 2016-07-28 at 09:55 +0200, Daniel Wagner wrote: > From: Daniel Wagner > > Factor out the firmware loading synchronization code in order to > allow > drivers to reuse it. This also documents more clearly what is > happening. This is especial useful the drivers which will be > converted > a

[RFC v0 3/8] firmware: Factor out firmware load helpers

2016-07-28 Thread Daniel Wagner
From: Daniel Wagner Factor out the firmware loading synchronization code in order to allow drivers to reuse it. This also documents more clearly what is happening. This is especial useful the drivers which will be converted afterwards. Not everyone has to come with yet another way to handle it.