From patchwork Fri Mar 9 14:47:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10270849 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 2A2946016D for ; Fri, 9 Mar 2018 14:58:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14E0329E4B for ; Fri, 9 Mar 2018 14:58:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08B6B29E4E; Fri, 9 Mar 2018 14:58:30 +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_SIGNED, DKIM_VALID autolearn=unavailable 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 80BD329E4B for ; Fri, 9 Mar 2018 14:58:29 +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=RdgX7pQKErmwKVfJq7tU25e/bo7ARZfX/2eYoTUbrJA=; b=hmRlGYx1ha+qGTCiTN9koSmp5E S6FaXY2OAmLG54xqhZK+pNyxBgW8qUoJ6xA84lCEdlU1P4/1q+jRo8GVlU9OLPnqaSXHadnG04egG XtPWGA1RnotHmmMHFHPZwHDG7DoGNr0KStNF4YBf1cl02GG2B0yRckQI0e2Gy6i0dPKky7rzPBE0Z u9b2J7PXBZZ08gbtYlw7llmFd6r6X4V4EfjFvVQztrIy8OKabVbOr+nYKXPEGJfrwCm+s0MMjeJmT BN7U3IPk9V0VuvTYZ7Cofx9a1WJctcqTJ1HqFU3CN+KCLtjPO9Raw0qszhLDzejBnpAPXwCFvV+dr Do5TYl6w==; 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 1euJTV-0005kJ-1N; Fri, 09 Mar 2018 14:58:25 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euJS5-0004o4-RA for linux-mediatek@lists.infradead.org; Fri, 09 Mar 2018 14:57:19 +0000 Received: by mail-wr0-x242.google.com with SMTP id v111so9303874wrb.3 for ; Fri, 09 Mar 2018 06:56:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AL3vSk4vvDm22SR1uW6+Qq0PXmzWtxma/3Yintv32TA=; b=YEPlV/JuPhVZZih3BQaJ/liMRNiRfPP6kLMzZtjp5EqasQrUM1hnTaXaUtzjA+IcXi jHJXoraTWchblW7ouLX3vg7hTSyYA7O5n+b2tXxiTP1rXDXgXAUduuFO1BJLdNPlTwGm D7IvoQlJLXqeQMsa+eBZBZxjcRH1xNJ806pPE= 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=AL3vSk4vvDm22SR1uW6+Qq0PXmzWtxma/3Yintv32TA=; b=YCgJSrBfm2sRWSCZ2KsB9ZBAprJvbhWbtWT9QYnWRt2PmUW8fag+mdAiYOt7H61isG Foi5yFdFcKTYVixxduc6zfR/0MbId9QHt0ZyM+DjUIdsYG6/uPC810tZjLGsttcAAlv5 ZjERIIYS84Rge4ZGqniQzdOLoHQ78arB2rVAJGObzeC+FzNkJQRKkFN8Ryij6HtlTQPb oEg/PfozoiReb6/lkf2IxbMvZZOriU35bt3uUL1B2/f6CuHjygv1drjlm8Gqx27N36+H 4iXPYBOpE9gjEL/9E5DRAsl3Y27U97yU0TH8eDAY6OuAlNPVQlMdqZ+uXTXD8iD7f7+u BGSg== X-Gm-Message-State: APf1xPBxKblWwRxFuDbfxBtIM/qHnUYtnDKJZJSmUrUknAij8hiRoWKr LzfKSdfXYjlF3u4Rroa0geldTQ== X-Google-Smtp-Source: AG47ELt6RAdwft8KVMKEPHm6kuAdNQjDodlBfeAEQyUcCrkb7PKRFsUjU322S4/LUchvMbTPRGjXXQ== X-Received: by 10.223.139.68 with SMTP id v4mr27398823wra.23.1520607045497; Fri, 09 Mar 2018 06:50:45 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:44 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Subject: [PATCH 17/25] nvmem: rockchip-efuse: Make use of of_device_get_match_data() Date: Fri, 9 Mar 2018 14:47:11 +0000 Message-Id: <20180309144719.29904-18-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180309_065658_576778_D6E76CA0 X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-mediatek@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 , srinivas.kandagatla@linaro.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Carlo Caione , linux-mediatek@lists.infradead.org, cphealy@gmail.com, Matthias Brugger MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrey Smirnov 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 Signed-off-by: Srinivas Kandagatla --- 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);