On Fri, Nov 17, 2017 at 10:12:22AM +0530, Vinod Koul wrote:
On Thu, Nov 16, 2017 at 05:29:35PM +0000, Srinivas Kandagatla wrote:That understanding should be correct, as the reference count is
thanks for the comments.I thought since you are marking ctrl->dev as parent, the device core should
On 16/11/17 16:42, Vinod Koul wrote:
On Wed, Nov 15, 2017 at 02:10:34PM +0000,srinivas.kandagatla@xxxxxxxxxx wrote:This is controller device
+static void slim_dev_release(struct device *dev)which device would that be?
+{
+ struct slim_device *sbdev = to_slim_device(dev);
+
+ put_device(sbdev->ctrl->dev);
Yes.+static int slim_add_device(struct slim_controller *ctrl,is this controller device and you ensuring it doesnt go away while you have
+ struct slim_device *sbdev,
+ struct device_node *node)
+{
+ sbdev->dev.bus = &slimbus_bus;
+ sbdev->dev.parent = ctrl->dev;
+ sbdev->dev.release = slim_dev_release;
+ sbdev->dev.driver = NULL;
+ sbdev->ctrl = ctrl;
+
+ dev_set_name(&sbdev->dev, "%x:%x:%x:%x",
+ sbdev->e_addr.manf_id,
+ sbdev->e_addr.prod_code,
+ sbdev->e_addr.dev_index,
+ sbdev->e_addr.instance);
+
+ get_device(ctrl->dev);
slaves on it?
ensure that parent doesn't go off when you have child device?
Greg, is that understanding correct, if so we may not need these calls.
incremented on the parent when a child is added.
It would be trivial for this to be tested, and yes, I am pretty sure you
don't need this call.