lkml.org 
[lkml]   [2017]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v10 1/5] serdev: Make .remove in struct serdev_device_driver optional
    Hi Greg,

    On Sat, Nov 04, 2017 at 12:24:31PM +0100, Greg Kroah-Hartman wrote:
    > On Tue, Oct 31, 2017 at 09:36:52AM -0700, Andrey Smirnov wrote:
    > > Using devres infrastructure it is possible to write a serdev driver
    > > that doesn't have any code that needs to be called as a part of
    > > .remove. Add code to make .remove optional.
    >
    > What about manual unbind from userspace through sysfs? You need to have
    > a remove function. All drivers need that, to not have it is pretty lazy :)

    Resources,that have been requested via devres are free'd by the
    devres framework after the driver specific remove function. This
    also works for manual unbind.

    If *all* driver resources are allocated using devres, you will end
    up with an empty remove function. In that case it makes sense to
    remove it completly. This is what quite a few (mainline) i2c and
    spi drivers actually do.

    -- Sebastian
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2017-11-04 18:06    [W:2.962 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site