greybus: arche_platform: Remove child's platform device as part of _remove() fn
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Mon, 28 Dec 2015 14:36:32 +0000 (20:06 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 30 Dec 2015 21:18:32 +0000 (13:18 -0800)
commitbc142bbb4ceba0891db6bf36cfb7be13c9a2dd72
tree46bb8278593eaed53846b67a6262bc9b31723d05
parent41c23958557d9b37755768849ee39b99a9826a9c
greybus: arche_platform: Remove child's platform device as part of _remove() fn

It seems we need to delete platform_dev of all childs explicitly,
in _remove() fn callback of parent driver.
There were some discussions about having of_platform_unpopulate(),
but it never made it to mainline.

https://lkml.org/lkml/2013/7/19/615

There are some drivers which are removing platform_dev explicitly,
as done in this patch.

Note that, without this, multiple insmod-rmmod won't work, as I see
driver probe gets invoked twice and leads to failure of probe.

Signed-off-by: Vaibhav Hiremath <hiremath_vaibhav@projectara.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/arche-platform.c