drivers: base: remove check for callback in coredump_store()
authorArend van Spriel <aspriel@gmail.com>
Thu, 15 Mar 2018 09:55:25 +0000 (10:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Mar 2018 17:08:02 +0000 (18:08 +0100)
The check for the .coredump() callback in coredump_store() is
redundant. It is already assured the device driver implements
the callback upon creating the coredump sysfs entry.

Signed-off-by: Arend van Spriel <aspriel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/dd.c

index de6fd092bf2fe2f2c2caf90841f9407ec07642a8..c9f54089429bde006fad1135017d49a0422fefa5 100644 (file)
@@ -292,8 +292,7 @@ static ssize_t coredump_store(struct device *dev, struct device_attribute *attr,
                            const char *buf, size_t count)
 {
        device_lock(dev);
-       if (dev->driver->coredump)
-               dev->driver->coredump(dev);
+       dev->driver->coredump(dev);
        device_unlock(dev);
 
        return count;