From patchwork Thu Mar 8 19:12:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10268929 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 D62C96037E for ; Thu, 8 Mar 2018 19:26:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4A9629993 for ; Thu, 8 Mar 2018 19:26:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8FDC29AF0; Thu, 8 Mar 2018 19:26:37 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM 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 672A129993 for ; Thu, 8 Mar 2018 19:26:37 +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=vSItnUTFuiCzukMNLzQ0oxf8ZcUkJIhhbNBVaH28hPU=; b=sWeZfigp9wvqZyGhQIICiAr/hn 7nhs0AzAbIhlUHAgwz74iYCYLAdZiahllpMbApD6zmYttZ774aXUao9mGghv20ubfu/KIitWICF24 zvLNlKiL62JJw37/s+gSZrIwpy7rqU+77Oyx8AG/V12qk9xkW3YccIVD17+89vjVb8vmRB9WFAnNy Hjapz3gegq9mWSD+jkl5yn4sTv/Bm+/HHh2UakAGES0mX/fxqCi2wzHgaHKQMPRUkqsv0qEDlUg4k hn4+bpD3Jns7TCkDuEFX5IriYVfNc3dl7jt60XK7mHL+haouX12RM4I0S9fTz+DiAVIlfLRcdmnDK 4iaJvtdA==; 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 1eu1BR-0005At-Py; Thu, 08 Mar 2018 19:26:33 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eu0yI-00022Z-3G; Thu, 08 Mar 2018 19:13:17 +0000 Received: by mail-pg0-x242.google.com with SMTP id y8so2582966pgr.9; Thu, 08 Mar 2018 11:12:46 -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=9iW6vZix5HySkruUdaw2O1t/iJrHYiVBftssMRC+7JY=; b=p/NNAhfBmIb7VKSgcvzQ23slOwux6B1PwdpN1OJaK8ug1jymYoU66pRf1s1gu5VYOV 39aiCu29LRneHRvx6/aTV7lCMpoMv4p1UuRPSzIrt1lFTThy75YWVTihL4Qq1mF/qa8n BziouZWuEeFw97AjdN465mX2NJw8UneEGkj+6bEuqcmJ2rr/EDM7N1PmFG8W0N0r2yZW r5QYl+j/TtRCk6UmQ1QjClt3oG6v9FXedAVJoL4nLNluMSaZNvpKtoZpZh1H7LwuR1ZT Gaq/k1Ve0yt0/QJrjJDRtPpB7cXQnSLfXhoHVW56d8yKDweS+TBSmXnoP9MOTZNk9VNa mE2g== 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=9iW6vZix5HySkruUdaw2O1t/iJrHYiVBftssMRC+7JY=; b=JOtpePWnQxcKZP/o2/k8u3xDfNQubjZyYztt5q19t4UaLBPV+bI6RZ0FeLuzZlB+vC YpmAwDHff8BXE+rcmqYmfneIzqhi+T7Uox0W7Pb77vCA3SzBFgkzh/HfESbh7A8JUiOf YA5iKrxvjV/YdWY5x7aO1zg5m3vbVOJqG7BgHttM/WnNibbZah5XqcEoG2lIcssyZvWF r2YaHkrdYoCEVdHS9eAz/DDJ/wBXR3Z5SGklQP9IhrlaaeQY1cprifu8rIHkGRfg/zCL q4z8Qv/ys2TOllfSUpqayecXqzYROTioj5po+J1YR6jVdbmxqQiN0p8vuqRhltmKA+aV jn2A== X-Gm-Message-State: APf1xPCe5jTpwoo5Gv7JPDw74C+/7VmMuyWkjn48l21SYUBHBfOx1JIK OTaPnhz3dokoIy3fT1VTk/M= X-Google-Smtp-Source: AG47ELttCZxpSUA9IOPMpqC5Eb4cfJQy2MeL2rWUBZ/zhXpOtuvAvv+qsg+guZNdDReXKkfgIIrNQw== X-Received: by 10.101.90.203 with SMTP id d11mr21694726pgt.366.1520536366128; Thu, 08 Mar 2018 11:12:46 -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 j64sm47201768pfe.68.2018.03.08.11.12.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Mar 2018 11:12:45 -0800 (PST) From: Andrey Smirnov To: Srinivas Kandagatla Subject: [PATCH v5 17/21] nvmem: rockchip-efuse: Make use of of_device_get_match_data() Date: Thu, 8 Mar 2018 11:12:01 -0800 Message-Id: <20180308191205.26943-18-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180308191205.26943-1-andrew.smirnov@gmail.com> References: <20180308191205.26943-1-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180308_111258_896924_01201873 X-CRM114-Status: GOOD ( 11.95 ) 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 fec6e4c48b9a..ade8848adf82 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -259,11 +259,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; } @@ -286,7 +286,7 @@ static int rockchip_efuse_probe(struct platform_device *pdev) if (of_property_read_u32(dev->of_node, "rockchip,efuse-size", &econfig.size)) 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);