[PATCH v2 0/4] libusbg: Add support for functionfs

2014-06-11 Thread Krzysztof Opasiak
Dear Matt,

Configuration of function fs based functions using config fs has been
merged to linux kernel quite long ago. To keep libusbg up to date I
have prepared patches that add support for functionfs function type.

When working with ffs I noticed that it would be a good feature to
provide device name directly to user and avoid him confusion that
instance name has to be the same as device to mount ffs. That's why I
have added structure for ffs attributes which has only one, pure
virtual (not present in configfs and read-only) attribute dev_name.

Now user can create ffs function in a two ways:

1) Pass instance name name and then get function attributes (device
name)

2) Pass NULL as instance name and pass function attributes with
desired device name

First commit in this serie fix potential memory leak which could
take place in usbg_init(). To avoid this usbg_init() has been
refactored and now all memory should be free() properly.

I have created pull request on github with those patches [1].

Please also notice that there are still two pending patch series:

1) Remove gadget functionality [2]
This one has been changed according to your review but is still
pending for over a month.

2) Couple fixes from Philippe De Swert [3]
That's a few commits which fix errors reported by coverity.
I have reviewed this serie, build and run and it looks good
to me. Please also run through this code and merge if you
don't find anny issues.

Footnotes:
1 - https://github.com/libusbg/libusbg/pull/5
2 - http://github.com/libusbg/libusbg/pull/3
3 - http://github.com/libusbg/libusbg/pull/4

--
BR's
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
k.opas...@samsung.com

Changes since v1:
- show-gadget example has been also updated
- out label has been moved to more suitable place

Krzysztof Opasiak (4):
  libusbg: Fix potential memory leak in usbg_init()
  libusbg: Add support for functionFS.
  libusbg: Update show gadget example support ffs functions.
  libusbg: Add example to show how to create ffs functions.

 examples/Makefile.am|3 +-
 examples/gadget-ffs.c   |  154 +++
 examples/show-gadgets.c |3 +
 include/usbg/usbg.h |   14 +
 src/usbg.c  |   57 ++
 5 files changed, 218 insertions(+), 13 deletions(-)
 create mode 100644 examples/gadget-ffs.c

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/4] libusbg: Add support for functionfs

2014-09-23 Thread Matt Porter
On Wed, Jun 11, 2014 at 05:09:46PM +0200, Krzysztof Opasiak wrote:
> Dear Matt,
> 
> Configuration of function fs based functions using config fs has been
> merged to linux kernel quite long ago. To keep libusbg up to date I
> have prepared patches that add support for functionfs function type.
> 
> When working with ffs I noticed that it would be a good feature to
> provide device name directly to user and avoid him confusion that
> instance name has to be the same as device to mount ffs. That's why I
> have added structure for ffs attributes which has only one, pure
> virtual (not present in configfs and read-only) attribute dev_name.
> 
> Now user can create ffs function in a two ways:
> 
> 1) Pass instance name name and then get function attributes (device
> name)
> 
> 2) Pass NULL as instance name and pass function attributes with
> desired device name

This is great, I just made use of this in an application I'm working
on now and like it.

> First commit in this serie fix potential memory leak which could
> take place in usbg_init(). To avoid this usbg_init() has been
> refactored and now all memory should be free() properly.
> 
> I have created pull request on github with those patches [1].
> 
> Please also notice that there are still two pending patch series:
> 
> 1) Remove gadget functionality [2]
> This one has been changed according to your review but is still
> pending for over a month.
> 
> 2) Couple fixes from Philippe De Swert [3]
> That's a few commits which fix errors reported by coverity.
> I have reviewed this serie, build and run and it looks good
> to me. Please also run through this code and merge if you
> don't find anny issues.
> 

Applied to master, thanks!

-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html