From patchwork Wed Jan 3 20:01:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10143399 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 59F7A601A1 for ; Wed, 3 Jan 2018 20:43:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FCA329323 for ; Wed, 3 Jan 2018 20:43:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 444652932F; Wed, 3 Jan 2018 20:43:36 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 EBBF02932B for ; Wed, 3 Jan 2018 20:43:35 +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=aSNmLKO0gqHCWUz8vzvo9/q6HBowb34XImylOj4+v7A=; b=aMgcbt1plExyIxvBhufUQd2zHU F8WfAUJ1PoVZLCKB9WGyIEm4oviA/l8Ycp0/22MSg7qLTqqyXGX2/yLjUwK07/FhMdg56uNaOb4BY UcSMMM418CnibejcQGuUKjZ1NEKMhM4GsbjOfemZFUCkHU38VkhB8f0GKXD8Lserps0QDUapLT+A4 wqRZpvrpou8hbUj6XQtPmm8kXD8LmigQT7KojDV/HjviEOCkgXWRDJrLeNknz06a+Wc/Ky8OfkwsQ rkjKMGcMzxhRxosh2z/We3LEqlsWXU3Tt0DxFxU9Gdf8eYLQPTUPFntSVqrLXMDN9l1MteoIERl7w Luv0FCDg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eWpsf-0000ra-2P; Wed, 03 Jan 2018 20:43:21 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eWphk-00044X-3C; Wed, 03 Jan 2018 20:32:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dryjRcFgZhOM1l6QJYBtdemhTcik3tnkcV8v4roerik=; b=o956UhwWAA4BpSw3Xk0GgiBNr M+ZnilJ8epklUS2i6OtBXAUtyOuoZRkY7iv8flzSJ1tZVqmnEcUaq+Xz8cz9fqrGLv7RZIS9be9l8 FyjPiMs39nR6JJyXKkO0ozdy2CM0gfq7Tl9UbvyJ0NHD3Hp6VvrM8hWbhu8AXjJpsT0/zT6DeGdpo luzvFIFFmb1uoftK/DmzHVZz6O70ufCcGMBl86QnmXrqG3PC+6hjf6Mxbqmqo2DjMmf1Y+Hb+B3Z7 236eHOL5iiYjB9/gWNp0vBiTg7liyUAEqvoIOuouejU+HeDUgf93i3y0dRKJJJH7Ak3CgriaW533N mj8n9PJVg==; Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eWpEX-0003zj-D8; Wed, 03 Jan 2018 20:01:57 +0000 Received: by mail-pg0-x243.google.com with SMTP id q67so1079558pga.9; Wed, 03 Jan 2018 12:01:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dryjRcFgZhOM1l6QJYBtdemhTcik3tnkcV8v4roerik=; b=YoqCSHBv1ADas44XqocftoSQ7XccOvrlVQPoQlM5wkxCNndsecxTII+5UsLLpvPHFy YZ700rcNfBIjIvvDnrlxNOWm5geUAixptWD90DG1cjofuWQSrlK76lxBrNGPHOImXJ3M r3JQA0O09UJYkkuOmE8XdjWsjPQJUVsw1G2Jr96PrNp52vqN/3Yg1UHvyop2P4d1TX8T CwV0mVehcTXBbV97c05YI8HcJ6weybADVX/fBWxFROmM9v9p6ApqSrrI/JRp8zA8Actc 5N8TOEPpNzrm9ipGhxKoKMcfcIsOWhRDHeVV+j03Ld1nFPRf9F3k0RtMf/Gcbb7c4tPC d2NQ== 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=dryjRcFgZhOM1l6QJYBtdemhTcik3tnkcV8v4roerik=; b=AgIXFvnLOrAyZ1r1t23l5/RBfMwtr90/P/8gcFZ2TIiTShdbcxzM1WLk2SaIENVisg /6G0FHW2vrfesR+PMLtxySb3D9T4ZY6wcc2oOscWFMo58ZHK5DSwq+7VohX5TUbaXeuN FEjsaBf/swX50eFW1kjZf/UWP+78+wiV5LSM5t/TE74ZXHra5/RQwwcbleUDQyPtgHMg XtjMU9NWRMCxbx/+BRYdAT2qDY3NlRwqSbHFkRkDSIGpG5QvOw25FONowwpSASeEr7m3 xN8eA8Z3BQF1m8AnTes1vpZ+M3wxZB+mGpU785LGP7r8WRMqowlN52mS73pf2m25I73b tQ/A== X-Gm-Message-State: AKGB3mLC9oxmmHqVk7TvzV9nl8JlcsIkfoCuNJ6fgRlZKFvdAMmAQwNA uMDNT3tWYkT7lpTvrztOGbg= X-Google-Smtp-Source: ACJfBosQxp+8nSz0/A9d2dU1WNr6LK3JqvNqmkpA9Lg+s/dYeLN9IhKHLGkLXhSAK+WkpQ5oNcZnTw== X-Received: by 10.98.46.7 with SMTP id u7mr2438512pfu.37.1515009700788; Wed, 03 Jan 2018 12:01:40 -0800 (PST) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id b9sm4542209pfl.108.2018.01.03.12.01.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jan 2018 12:01:39 -0800 (PST) From: Andrey Smirnov To: Srinivas Kandagatla Subject: [PATCH v3 18/22] nvmem: rockchip-efuse: Make use of of_device_get_match_data() Date: Wed, 3 Jan 2018 12:01:10 -0800 Message-Id: <20180103200114.23922-19-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180103200114.23922-1-andrew.smirnov@gmail.com> References: <20180103200114.23922-1-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180103_200153_546515_41094E50 X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-rockchip@lists.infradead.org, Andrey Smirnov , Kevin Hilman , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Matthias Brugger , linux-amlogic@lists.infradead.org, Carlo Caione , cphealy@gmail.com MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify code a bit by using of_device_get_match_data() instead of of_match_device(). Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov --- drivers/nvmem/rockchip-efuse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index d6dc1330f895..979ba0a376a0 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -193,11 +193,11 @@ static int rockchip_efuse_probe(struct platform_device *pdev) struct resource *res; struct nvmem_device *nvmem; struct rockchip_efuse_chip *efuse; - const struct of_device_id *match; + const void *data; struct device *dev = &pdev->dev; - match = of_match_device(dev->driver->of_match_table, dev); - if (!match || !match->data) { + data = of_device_get_match_data(dev); + if (!data) { dev_err(dev, "failed to get match data\n"); return -EINVAL; } @@ -218,7 +218,7 @@ static int rockchip_efuse_probe(struct platform_device *pdev) efuse->dev = &pdev->dev; econfig.size = resource_size(res); - econfig.reg_read = match->data; + econfig.reg_read = data; econfig.priv = efuse; econfig.dev = efuse->dev; nvmem = devm_nvmem_register(dev, &econfig);