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: 131125 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1079941lja; Fri, 9 Mar 2018 06:53:07 -0800 (PST) X-Google-Smtp-Source: AG47ELvmSykebEgOKuv72qYTOrdIMkkCJ2a6lxswcAzhzhDAxqzZAslrqWBC0oeQUqUOnHbU0L1z X-Received: by 10.99.55.70 with SMTP id g6mr24503128pgn.284.1520607187193; Fri, 09 Mar 2018 06:53:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607187; cv=none; d=google.com; s=arc-20160816; b=HCq1qVYMb5I+a2qYtRqprbG5yJHQPPwLTiIWk4Z0qIEOe1zo+ELXjzwxzW7JGpNldT HMv9IQgbO8S5ymoETrG61zvzL8Tkwzav7vtp7x1UmehhqRX8uKTjT1HvimPsqrltVXa8 HnbAbwVhWiqRAtbzom7iqtD93cyFZO/f+ie6OuCDFH/sdVZbXLCFxNdaplsSNeIZ2269 Wk3YIw/w8acrU/3y7oHiXV1CvDDDkuW6XlFe+37UFNKPMMT4+ixIVfA5d3N/phDeGHmn dW5Rj86csDLh+zxnm0edg0N12kPEnnLRmGCRfodY40y6ygAfM+/6MVIoMCAbHd6lISl5 2zTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=AL3vSk4vvDm22SR1uW6+Qq0PXmzWtxma/3Yintv32TA=; b=BTYbf8ZiLTZqzirUSvlDk1PAgqUx7DTvSObyREATV5MuWlTVyP1ARpkg69sAoXC0Np gwHr7ztHXPFwnJo9SOJ73HxiBvx2Bb5ZK1yRifiZyv/dUHa7rk5ii37WtVsTFrT2F12V 546QdeMuI+FPmctUFQdSJyrTVhhNgN95bMNLG71fSHsXH1saB4hzAo6JGCLXl1a1BMVZ tNbGscHAcjqPD0FsuwWr7/tYQ5G+CNuN2TAFFOjI85/535B5EotI707KgbUaimhhh1Hv lE+/uTjNxMpApFY1BL1jHkJcVHlSulnJ0G+gECwoLV8FFT0XcazeS0it+aCcCBN3y+G3 cqxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YEPlV/Ju; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si809859pgv.563.2018.03.09.06.53.06; Fri, 09 Mar 2018 06:53:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YEPlV/Ju; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932405AbeCIOxD (ORCPT + 28 others); Fri, 9 Mar 2018 09:53:03 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:41532 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932361AbeCIOuq (ORCPT ); Fri, 9 Mar 2018 09:50:46 -0500 Received: by mail-wr0-f196.google.com with SMTP id f14so9267424wre.8 for ; Fri, 09 Mar 2018 06:50:46 -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=JYm8CPl/EnLTUQPwsVouT06RTUmf3je0RMRJ8YUag9cqO/a2GUJBRuN9siCm8G0YVz IqUds0cOdhVoLVmMqYh8OOvNyMRM16YvyNXF7ar7IuYBxzLTncUEzXb7Rl/23CG/9xGE SdtzcAWEGOWEiCIGNQsapSqWQ6ZvLI/rEYsB62e/aJrkeMST6tq5M6dvt8XyOV6RmShu uwBhfUcPNt1/SZE5h3rN/feMBLmAGGHgjTO4acQ4uCoyb+1xj3O8EhgG0YvrET7pu3YA oebBcD0FjC3j5Cz8Cr4j8I0IjLnx4kYzN16B1JNMF/OD9xv+o2qqW7lysq6ZJ9LvJkqf taPA== X-Gm-Message-State: APf1xPDB73jI4oeA49LRMpY22YZ1gBW3emL5wlyv0J0cbtybyQAbhna0 3RqNWDkCB3g+PQ/pmR9ipM6TNA== 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 Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.15.1 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);