On 06/29/2016 09:51 PM, Xiao Guangrong wrote:
> On 06/21/2016 12:31 AM, Kirti Wankhede wrote:
>> + mutex_unlock(&parent_devices.list_lock);
>> + return parent;
>> +}
>> +
>> +static int mdev_device_create_ops(struct mdev_device *mdev, char
>> *mdev_params)
>> +{
>> + struct parent_device *parent = mdev->parent;
>> + int ret;
>> +
>> + mutex_lock(&parent->ops_lock);
>> + if (parent->ops->create) {
>> + ret = parent->ops->create(mdev->dev.parent, mdev->uuid,
>> + mdev->instance, mdev_params);
>
> I think it is better if we pass @mdev to this callback, then the parent driver
> can do its specified operations and associate it with the instance,
> e.g, via mdev->private.
>
Just noticed that mdev->driver_data is missing in v5, I'd like to have it back
:)
Yes either mdev need to be passed to parent driver (preferred), or
find_mdev_device to
be exported for parent driver (less preferred, but at least functional).
--
Thanks,
Jike