]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/chrome: cros_ec_debugfs: Remove dev_warn when console log is not supported
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Wed, 3 Apr 2019 13:47:18 +0000 (15:47 +0200)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Fri, 5 Apr 2019 09:48:07 +0000 (11:48 +0200)
If the debugfs interface is enabled, every time a CrOS device is
instantiated a warning like this can appear for every probed device.

 "device does not support reading the console log"

The warning message adds nothing, rather it is source of confusion as
this is expected on some cases. For example, on Samus, that has a
cros-ec and a cros-pd instance the message appears twice, and I suspect
this will happen also on those devices that has a non-standard EC.

If the command is not supported just return silently and don't print the
warning, otherwise the code will already print an error.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
drivers/platform/chrome/cros_ec_debugfs.c

index 71308766e89199f443047c715f5ce3206375df70..f0de1991b68844603d163719da012a0587654ca0 100644 (file)
@@ -306,11 +306,12 @@ static int cros_ec_create_console_log(struct cros_ec_debugfs *debug_info)
        int read_params_size;
        int read_response_size;
 
-       if (!ec_read_version_supported(ec)) {
-               dev_warn(ec->dev,
-                       "device does not support reading the console log\n");
+       /*
+        * If the console log feature is not supported return silently and
+        * don't create the console_log entry.
+        */
+       if (!ec_read_version_supported(ec))
                return 0;
-       }
 
        buf = devm_kzalloc(ec->dev, LOG_SIZE, GFP_KERNEL);
        if (!buf)