]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
nvmem: meson-efuse: simplify read callback
authorJerome Brunet <jbrunet@baylibre.com>
Fri, 11 May 2018 11:07:00 +0000 (12:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2018 14:20:48 +0000 (16:20 +0200)
Most of the code and variables in the read callback is not necessary.
Keep only what is required.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/meson-efuse.c

index 2df9b0094f450b2e9566962c6f9a04b5a9a23a0d..4623249dfd87947a63f8626a1c9a8177ab4ce63f 100644 (file)
 static int meson_efuse_read(void *context, unsigned int offset,
                            void *val, size_t bytes)
 {
-       u8 *buf = val;
-       int ret;
-
-       ret = meson_sm_call_read(buf, bytes, SM_EFUSE_READ, offset,
-                                bytes, 0, 0, 0);
-       if (ret < 0)
-               return ret;
-
-       return 0;
+       return meson_sm_call_read((u8 *)val, bytes, SM_EFUSE_READ, offset,
+                                 bytes, 0, 0, 0);
 }
 
 static const struct of_device_id meson_efuse_match[] = {