[PATCH] serial-port: turn open_count assertion in mm_serial_port_close into simple return

Aleksander Morgado aleksander at aleksander.es
Mon Jan 13 00:57:22 PST 2014


On 13/01/14 03:48, Ben Chan wrote:
>> One option would be to have all the MMQueueData items be completed in an
>> > idle, so that when they are really completed the port was already marked
>> > as forced_close. I know it's probably too much just to handle this case,
>> > but I also think it's important to warn about the incorrect open/close
>> > counts; and the idle completion is actually a good idea as we avoid
>> > chaining up normal close()s within the forced_close() call.
>> >
>> > I'd suggest to wait until we release 1.2, because after that I'd like to
>> > merge the 'aleksander/ports-refactor' branch, and in that branch the
>> > change needed to have the MMQueueData item (named CommandContext in the
>> > branch) completed in idle is just a rename of
>> > g_simple_async_result_complete() to
>> > g_simple_async_result_complete_in_idle().
>> >
> complete_in_idle would work but that requires all contexts to be aware
> of the semantics. Is the CommandContext going to replace all contexts
> (i.e. one rename is enough)?

It should be just one rename, yes. CommandContext (GSimpleAsyncResult
based) will replace the MMQueueData struct internally, and as long as
the GSimpleAsyncResult contains everything needed to propagate either
the error or result string to upper layers, there shouldn't be any major
other issue to handle.

-- 
Aleksander


More information about the ModemManager-devel mailing list