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: 10270835 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 AC1356016D for ; Fri, 9 Mar 2018 14:57:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9ED1929E4B for ; Fri, 9 Mar 2018 14:57:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9320929E4D; Fri, 9 Mar 2018 14:57:06 +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=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 50B4C29E4B for ; Fri, 9 Mar 2018 14:57:05 +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=K0Haa7ocjEZoVcEPJy5m/ht7vX1V9Sb7kHT8/51TjDs=; b=BTEgw4hunRc2vGLz34zwAZWn8j 2L1z7CQ/OKD2Dy+d0yx64m+7qxknVXFhMukMR/OZCq06w0l/ybzv6A9XcCcM4XmuQobglNT88Y/yW ileoqQIbIzaVZtGybExnORGGv5SnVz70vJlBGbRHAe9211W7jeGbF8rWNGdltWb+Z/ArZJxK/99Xe VCz2U0c5FDQDa0/C3xkpHbqTXUqwxxgv7PizT7rx54Hc7Kug3R1mrAc0KGF1zg2KBMFJ/5Kq4JcaK pq9s41jFHouZyXp2pj2BKOxNduT2W3EnEuD5uQsB+yN/qmAZJ84NHQDvvwSIRm/zINymW4ox1FzvI nquJBzRw==; 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 1euJS2-0004rC-MC; Fri, 09 Mar 2018 14:56:54 +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 1euJRK-0004Lp-5M for linux-arm-kernel@lists.infradead.org; Fri, 09 Mar 2018 14:56:29 +0000 Received: by mail-wr0-x244.google.com with SMTP id h2so2000924wre.12 for ; Fri, 09 Mar 2018 06:56:01 -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=PKCLYp+0jnIi+Q949L15tp/p1KmqzeXbpPS90GGci9mEyscydY5bzblC+nKEUvzpqY mXtn1hnuFOARxrJsVWz7evd2xk3D4NMK0jHjGKEKn+Fti5/zZBPKADOBu9w2HbNT45jK 0xNfHozzjK2GJ6lLqMfteLi4NtZVf5mDBbSxrkIxrFLL19LuDe5V+qI2RLNYK7pRT9yn SHpMygWsLD7hc2NTAoqAHzVlQ83u+VlBMi3Hml/yyNB2DXYNR9UnlQZIgwykkUyIQMn7 3bbckdnx6CfLTPFKT9bRxoyn5xb/XhY1t0aDnoSQaVxJ5znQ1ZFDEJkSWfSaPgEH8M9S HLmQ== X-Gm-Message-State: APf1xPAK793Ut2ciM9E1GSerZWaOXV4tZXl6ZdxbmZuzlfUc8mvMMfQn wpheu/mQfajgl3dum6wfdtmNvw== 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_065610_841281_5366D418 X-CRM114-Status: GOOD ( 14.91 ) 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 , 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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);