aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/interface.h
diff options
context:
space:
mode:
authorGravatar Viresh Kumar <viresh.kumar@linaro.org> 2015-04-02 17:53:47 +0530
committerGravatar Greg Kroah-Hartman <gregkh@google.com> 2015-04-05 16:23:22 +0200
commit2352a73212a503dfe77970c48a891c008b7edd5b (patch)
tree261e48edda13b9be7b968a016c22b9516879c0ef /drivers/staging/greybus/interface.h
parentgreybus: Initial I2S definitions (diff)
downloadlinux-2352a73212a503dfe77970c48a891c008b7edd5b.tar.gz
linux-2352a73212a503dfe77970c48a891c008b7edd5b.tar.bz2
linux-2352a73212a503dfe77970c48a891c008b7edd5b.zip
greybus: Unregister devices to get them freed
Devices registered with the device-core needs to be freed by calling device_unregister(). For module we are calling just put_device() and for bundle, connection and interface we are calling device_del(). All of these are incomplete and so none of them get freed, i.e. the .release() routine is never called for their devices. Module being a special case that it needs to maintain a refcount or a list of interfaces to trace its usage count. I have chosen refcount. And so once the refcount is zero, we can Unregister the device and module will get free as well. Because of this bug in freeing devices, their sysfs directories were not getting removed properly and after a manifest is parsed with the help of gbsim, removing modules was creating problems. The sysfs directory 'greybus' wasn't getting removed. And inserting the modules again resulted in warnings and insmod failure. WARNING: CPU: 3 PID: 4277 at /build/buildd/linux-3.13.0/fs/sysfs/dir.c:486 sysfs_warn_dup+0x86/0xa0() Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/interface.h')
0 files changed, 0 insertions, 0 deletions