Re: [PATCH] drivers/base: use a worker for sysfs unbind

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Daniel Vetter (2018-12-07 09:31:33)
> +void unbind_work_fn(struct work_struct *work)
> +{
> +       struct unbind_work *unbind_work =
> +               container_of(work, struct unbind_work, work);
> +
> +       device_release_driver(unbind_work->dev);
> +       put_device(unbind_work->dev);
> +}
> +
>  /* Manually detach a device from its associated driver. */
>  static ssize_t unbind_store(struct device_driver *drv, const char *buf,
>                             size_t count)
>  {
>         struct bus_type *bus = bus_get(drv->bus);
> +       struct unbind_work *unbind_work;
>         struct device *dev;
>         int err = -ENODEV;
>  
>         dev = bus_find_device_by_name(bus, NULL, buf);
>         if (dev && dev->driver == drv) {
> -               if (dev->parent && dev->bus->need_parent_lock)
> -                       device_lock(dev->parent);

Do we not need to keep this locking in the worker?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux