From patchwork Mon Jan 1 23:23:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10139793 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 B2DFE601A1 for ; Mon, 1 Jan 2018 23:36:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A331428717 for ; Mon, 1 Jan 2018 23:36:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9512C28725; Mon, 1 Jan 2018 23:36:11 +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 0AB5428717 for ; Mon, 1 Jan 2018 23:36:11 +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=ENceNVCP171hJI5jZJ1lW8b/IvIgMsoEWfvg0Nv9XFk=; b=LzxxvwYbCNgDhcabtmFrM+hAMs k3ZXpnhW8h8RFBck8BYR60YYf2fZ5vslcr4WdZjroyUaNSPGmEQli/s5df0yXjw4AnIldTQ1F7ZNJ jg5yhzMjSPpbBBQRoeRJQT5ofJ+B3b92nQHyBvkCIjf2Wu+Zwb6zLFUOTt2rKqhUvzyknl03+fWfX iY5ZX5Uzn49vElFRUfbFlWR7FXZrmMv1m7g028PFZZ2d5XkMJ9JjJ5EK+BrQOIGOaWMOYXFb2ekCD IZTMA1wcUhWXpenuYwDMG/YkcQBjjn5Ut0BV3HRFJcPe32Ci9S6A4i95baWCXn/v6A5qxkzXF8ESy joE9Wr1Q==; 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 1eW9cl-0001Ff-1L; Mon, 01 Jan 2018 23:36:07 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eW9RM-0007c6-P8; Mon, 01 Jan 2018 23:24:47 +0000 Received: by mail-pf0-x244.google.com with SMTP id v26so24990828pfl.7; Mon, 01 Jan 2018 15:24:10 -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=KoKtXvBbodSLa/YzIFe42CtcHC1xDWPughnfpHyhQ/yMIa8ew0t4MgS9l5mHo3dzAQ N1H/bpq+Jrk2UVWgoQVuilnzRrVrowU2NQTjlCs+rzefY18YD8GOFG0G0qU/gWB0RlIv aunj4VqA4plc9Muf6oOU9Fdf1GN5yZPitXz1k/MgBDPBgFFuFus0APH9u1Ufy2ofpHCb h4tvZdt0wh1LysJ57v0rk8qAaG65D8IMafTzI2ILCtxxVXhCezOZNW+ZEr0EXigaZBzO 20+7qXJuhiyhz/C+6wdn13iZx2EX7bp+S/oZ2X2QfXI4/w6leTBMW5rVxqHFVKbf0qpw fsrA== 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=ESKsbfZdhHUXYizqcg+IKBXeFO3qWTjEaEOysLpRV/Y4DXOGBRRwnNoguPxWfer+29 BquyditbvZoi7DmRVAoNKwZ86YeZ5wgRMzx/LWHl5wrHveNrg+0qV3LYPDdeCFKey/yc ctZ0VmREiEJ7NlREOZx51a+9C3jNP/dwk69SvMzHAtVzHsb5bQrOmnCLfSHoXlVQ+dwh Wxv/tKrSBq7L3TxZxyXj6VFZWLFRjlhkG1vq7fI/KgRUDG+cv5VpYFJ/wjjA4bfYYdFR moyIXDVt2S9uxoHP3C9JWKRUaau08QAMdE3N8Hql3iJSKSqKCNt7tvSmDU1FkWiBDnMn ja/w== X-Gm-Message-State: AKGB3mIou1nnkFevFSdg7eD8q8++TWBcMCBYcJmM2ZVs/b8L+pUcsUQZ z654USfErul0q71iq4Qj840= X-Google-Smtp-Source: ACJfBosBxTvgDi715LnYKdLT0Wk94Ye9baF8jmNnZqBbMJGmPfTWxBFBMuNT4UTAUoU6jWuY3LRnyg== X-Received: by 10.99.102.1 with SMTP id a1mr6637756pgc.357.1514849049646; Mon, 01 Jan 2018 15:24:09 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id t75sm90857156pfi.146.2018.01.01.15.24.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jan 2018 15:24:09 -0800 (PST) From: Andrey Smirnov To: Srinivas Kandagatla Subject: [PATCH v2 17/21] nvmem: rockchip-efuse: Make use of of_device_get_match_data() Date: Mon, 1 Jan 2018 15:23:06 -0800 Message-Id: <20180101232310.30420-18-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180101232310.30420-1-andrew.smirnov@gmail.com> References: <20180101232310.30420-1-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180101_152421_400385_7BF03537 X-CRM114-Status: GOOD ( 10.09 ) 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: 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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);