From patchwork Wed Feb 28 14:41:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10247919 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 DC63E60211 for ; Wed, 28 Feb 2018 15:07:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCB4F2811E for ; Wed, 28 Feb 2018 15:07:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C109828396; Wed, 28 Feb 2018 15:07:36 +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 6FD902811E for ; Wed, 28 Feb 2018 15:07:36 +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=2Uam0zEat/XaLuT19INPH6ROsQ1W7jBHdMt6kqNUv/I=; b=tiZqQvICwwmeu3+bVFS7XdnE5p VmUxHCN0bteySDElIopq9xi2FHkGAidxJcMMWRhQ8blgPdhfqZzM9O2xNI26Bwrnm/QLFlcpjqow6 xbM0BAGCI8t4S/Nnd63E+0q5EWxEz5C7GmpXT0Jib+9CjzdWqaHBgSob+2XwV/YyFWKc7Gurk9ejr Q5c7xXtFfcGKKWGHNcfNW88UhASpXpHP1wOick7qUSeNEog6nkAbAPjb+962zkyBa6aujoW2NUoAO OC3Cy70FB+/Xw60N9LW/qvUwz4q2XJc7kXg01vrXU5LSBysBxy8r+oZ7KKippXbj5HiF+lTCRUOHE WlgrKCCg==; 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 1er3KP-0003dR-9V; Wed, 28 Feb 2018 15:07:33 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1er2vh-0000G8-2b; Wed, 28 Feb 2018 14:42:24 +0000 Received: by mail-pf0-x243.google.com with SMTP id u5so1066186pfh.6; Wed, 28 Feb 2018 06:41:50 -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=RIltTkdCymTH1olc/fwhFsDaaeTXdRfMQzlHP0n3wkQ=; b=TpC+4+71GWyUvUeYe/OO/LXAmCU9r7Y7SkGQ92y5Et7OAmdPY/MgHTyGHnS9vc0nZb fmlpoXDmGIKfyNwN0nC9qBgNFcUbDCGts7XJelE+RJERcCFXilrjYnaQUVUOkuyzvdql GRZ60i+RPiGXyiMej0VNh/UMm7JXXhaUzm8Z8PfFzp3ap4YLwgK/sCePajI9niZVgXRP wvC2v5t1VGKR4VuJZSMJIXmz8gH0/lge+/wdLDzYNpH6U/AznNFpwDQWRGa4dVz+/nO6 kzz9og4lts+dwAeIMANOeGN0QyaXXVuxDdyugR2kneoFg2tI3Dtg9xaJ2whKNJtsDmpf XQpg== 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=RIltTkdCymTH1olc/fwhFsDaaeTXdRfMQzlHP0n3wkQ=; b=Z7IJA4c5rx9Ora6FZNs2waBpwPhOw97OvBClJVbtdUkCKyQA7y0iRIMJc0UUlxwNbK aYrBHNBr5PQ1laEZ+ly6uRZ/A0sLhx3xyG+t3nRJji2KxRIQIGt07NgVl/AtK5M157k+ tlSRhYVaLW7mDV402H+ZSAHQIE7AAm77ALDpsz8gzZXBoNE5lnMyN0p6sW69F6n0rdk5 aZhnZf9pjNl8jO9prDeW7ZXC7V0dp0j0ct5aDDpOtYk0O34bsns/B82bwtSIO4Thy4Ae Rx5fAq1llYj7L6VAWfQ1ueRnI21lRrwwC9JIv6g/LZxuhnl80zmwyLfIfwpiGzBoi2Ly n9qw== X-Gm-Message-State: APf1xPAWe1S/1tUSoEo+Ekp4oDZEo/awrzgMQv1tKCtDRGLhRN4VQ+yG XIKQFm+L2/5qpijeSLipYto= X-Google-Smtp-Source: AG47ELvzU6SuD3UUX7EaUZ+rYpY54KROsAYjY5eDpl9hNldpKxYjMOptz1vmkp8nLvV2uE3ozkkzNg== X-Received: by 10.98.77.194 with SMTP id a185mr10353485pfb.123.1519828910123; Wed, 28 Feb 2018 06:41:50 -0800 (PST) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id h9sm3674312pgr.78.2018.02.28.06.41.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 06:41:49 -0800 (PST) From: Andrey Smirnov To: Srinivas Kandagatla Subject: [PATCH v4 18/22] nvmem: rockchip-efuse: Make use of of_device_get_match_data() Date: Wed, 28 Feb 2018 06:41:02 -0800 Message-Id: <20180228144106.16363-19-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228144106.16363-1-andrew.smirnov@gmail.com> References: <20180228144106.16363-1-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180228_064201_843101_7830A860 X-CRM114-Status: GOOD ( 12.12 ) 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 8ebb103abe23..ca686f8f5166 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);