lkml.org 
[lkml]   [2020]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 28/91] powerpc/pseries/cmm: Implement release() function for sysfs device
    Date
    From: David Hildenbrand <david@redhat.com>

    [ Upstream commit 7d8212747435c534c8d564fbef4541a463c976ff ]

    When unloading the module, one gets
    ------------[ cut here ]------------
    Device 'cmm0' does not have a release() function, it is broken and must be fixed. See Documentation/kobject.txt.
    WARNING: CPU: 0 PID: 19308 at drivers/base/core.c:1244 .device_release+0xcc/0xf0
    ...

    We only have one static fake device. There is nothing to do when
    releasing the device (via cmm_exit()).

    Signed-off-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20191031142933.10779-2-david@redhat.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/powerpc/platforms/pseries/cmm.c | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
    index 4ac419c7eb4c..25224c9e1dc0 100644
    --- a/arch/powerpc/platforms/pseries/cmm.c
    +++ b/arch/powerpc/platforms/pseries/cmm.c
    @@ -425,6 +425,10 @@ static struct bus_type cmm_subsys = {
    .dev_name = "cmm",
    };

    +static void cmm_release_device(struct device *dev)
    +{
    +}
    +
    /**
    * cmm_sysfs_register - Register with sysfs
    *
    @@ -440,6 +444,7 @@ static int cmm_sysfs_register(struct device *dev)

    dev->id = 0;
    dev->bus = &cmm_subsys;
    + dev->release = cmm_release_device;

    if ((rc = device_register(dev)))
    goto subsys_unregister;
    --
    2.20.1


    \
     
     \ /
      Last update: 2020-01-02 23:25    [W:4.230 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site