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: 10270855 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 3528060236 for ; Fri, 9 Mar 2018 14:58:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27D1E29E4B for ; Fri, 9 Mar 2018 14:58:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CAB329E4E; Fri, 9 Mar 2018 14:58:41 +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 AA57B29E4B for ; Fri, 9 Mar 2018 14:58:40 +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=0RBx/mNaZHF+s+PYxaW8MO+3kkzJkhVzeegtTFmmj04=; b=dzKvWh+0lek9imh5Fo3PyQqnR1 qqjBBWMUIyMP0D++VGyDhah/XU+uSv8n+bf2b7TmdrsE60cr3agXlRN1LneEIr24FVq3ZtAbxI52M /xLUydyQ6xARiBhpSRXY/MBvaBgz07VPVN62Ky6N9GG2J1850g+91uTGdni3r91/Hq4bvELby+Uye rqkYWn/ckN/CrKPO/CEDJS0z+ySdYD7PJBOQS4bw/Q6GfN8pCgj80tnpfrS6vUjRBXc0RDxc9yl4y FeCwFOIjTEPVZDPxQbdR+78wwUbNlLXSar43UkqH7ppTkz55K+l087IFDR6CzrQke5itgSMx+1S9z Vkn3lpDA==; 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 1euJTg-0005ro-TD; Fri, 09 Mar 2018 14:58:36 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euJSJ-0004wr-1p for linux-amlogic@lists.infradead.org; Fri, 09 Mar 2018 14:57:52 +0000 Received: by mail-wr0-x244.google.com with SMTP id a63so5680025wrc.10 for ; Fri, 09 Mar 2018 06:57:00 -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=Cy1XlVunKvpuJQxkMc5kNddsaGcOLtL5KjocZVl12yiw1Lt9gE22luo+YD72ectE7h GDGqEM6ucrw1uBd8ds0Jad7Klgjng3DS9lP3w3vBKS+xJORdx+7BMIrltzBGXYeFuoAP MSpTM6UcNtBISqo6EPNx/on00ruydXSS/ae/7WCGQaCXby19RxZdp1YVGqnSDm9pwPoX k+TY1PPC2AmeLwXmw7nDdWeRsPdjSUScj81tCoF6DsQlNLTukOhE9uj8szVRcZs7H3Xa sc6JzvbboNSwO16pCW3jgLC0S0P8qzq/MSFdAoapg6kWKgiZzoP89Nh7SuSHTngkTbZ9 2q4Q== X-Gm-Message-State: APf1xPAX5NcI1e2N4+TnLgshQpgAtknFprCM8JTsNiTctChTLWV5wed5 klVqpbyveZ6jopYG3I0965v7eQ== 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_065711_959255_9F4F1FFE X-CRM114-Status: GOOD ( 13.35 ) 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 , 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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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);