From patchwork Mon Apr 23 12:41:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10356941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 45B42601BE for ; Mon, 23 Apr 2018 12:45:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 360CA28ACB for ; Mon, 23 Apr 2018 12:45:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A57E28ACA; Mon, 23 Apr 2018 12:45:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7682328ABD for ; Mon, 23 Apr 2018 12:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=7KQ/s9/f9YAtmNEq4A7fwOnGqJzo7TU0fExUnBAhJCs=; b=E3pDzL6M5U4Jckx9suK1yCZSbF CB0Q8vtCyAJodVMJz+wnTksOR3mUaJDgzXh20UJnlSFRyG6z6qqVZcY7qQlxcPqoSJEbxdm/FdHqV zmzCHMZnUQSCb5rIqXkmfShZ4hRHRi9su6AFp3mszM8kdbh0F9pCI6J8A/kC+Uwnx85O0QHV7RTEo QbyEhrnPeIMTJSDWIeoUSyDR8M6k9mMQFvbDkUex69aMCOsirI20rNFENs5tICVMvUyeQIe3689nz 7s9baOEjg4Epd06UIbyhTvKVQ6xvjWVT5JWcGHievmW6v9pDGmqh1TX1sfulBWou7N//z12LZXqLy o9uN5fwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAaqG-0007kW-Um; Mon, 23 Apr 2018 12:45:13 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAanF-0006DU-Qb for linux-arm-kernel@lists.infradead.org; Mon, 23 Apr 2018 12:42:15 +0000 Received: by mail-wr0-x241.google.com with SMTP id v60-v6so40840566wrc.7 for ; Mon, 23 Apr 2018 05:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gISxAmx/ETJHVuen3Y/cxb7AXwzejKuk/MupUIcEk0I=; b=G6Zd1Q7T+C48a5ue0U0+8rmM1l2M6dgJoofyUursLaKlMI+VawRpOJNxKr5l/4jpQK TDZtxwXikufmpDoyb5G+UmxlyESN7JUORVWkDeAWutvD7Y6uF60pJcjca27xECo9V84M 8J4SZvkk9m4MAafGlEpXJ8DwEDpXxw+X2v5X+DDco0cF0s40c2NUHtnMq+ctHdlfinrV F45jaGPdMFjK1phqiHnRVRJ9/GTw+esosNkK3pYOGDoTye5OjBM6JsIaqCCCMlikUjBo KojXGobUKrSyw2dDN3s0nZkeewMOqH2GOU5Ihb+tmkLguJlyUCZ3jvcsoPIUAeadgZ7T pJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gISxAmx/ETJHVuen3Y/cxb7AXwzejKuk/MupUIcEk0I=; b=nUK0PpXdl4kwNBqhrTCzNXnPFIVZ6Ee4KNKzt4vc4aONwdEDT7bq8XPCXbPevw6Gv3 RayLwaJlgDsL3qnuz94715Xh4IXtfjCkNbirILb62pMk6QtZJRlwyYy6WCe3hBlyOi8K qOPEvxmbcPWkQLUzVcEd3AU582j04A+/H8Qwfhy24f7WUteqSoDgr2o189sHRL1pkW8p GSXc+fTAknvSeRmhGycXIvD7/xh4sGYAd+SzeupgmNjr3nino9+7RH0IwfLV787PYsd5 /hd7f1+sNeYYp9s/3pQvoDRB1wbAGVafGrP8dI8AACPYt754sxkh05z7W61xEPuT9oMU NW1w== X-Gm-Message-State: ALQs6tDJ4AMySl0n900dy6n5GqrgFJi/kdTGbzYIwG0p4BARWaQR9nYD 1yvDneOf97GSchXD/Xq7knUa2A== X-Google-Smtp-Source: AB8JxZoesh+VkmZHvJSk4kvuK/wihHaImIWzMIPl/SIPJcB/9/mkfZElh1JJNLWY8fkGK5bobGvFog== X-Received: by 10.28.230.28 with SMTP id d28mr9757396wmh.92.1524487315270; Mon, 23 Apr 2018 05:41:55 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id e202sm8727927wma.43.2018.04.23.05.41.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Apr 2018 05:41:54 -0700 (PDT) From: Jerome Brunet To: Srinivas Kandagatla , Carlo Caione , Kevin Hilman Subject: [PATCH v2 2/3] nvmem: meson-efuse: simplify read callback Date: Mon, 23 Apr 2018 14:41:48 +0200 Message-Id: <20180423124149.3077-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180423124149.3077-1-jbrunet@baylibre.com> References: <20180423124149.3077-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180423_054205_911503_E6CBCBD3 X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Most of the code and variables in the read callback is not necessary. Keep only what is required. Signed-off-by: Jerome Brunet --- drivers/nvmem/meson-efuse.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index 2df9b0094f45..4623249dfd87 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -24,15 +24,8 @@ 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[] = {