From patchwork Wed Dec 27 22:59:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10134301 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 4774D6020A for ; Wed, 27 Dec 2017 23:13:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39F1D2D478 for ; Wed, 27 Dec 2017 23:13:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E9E52D479; Wed, 27 Dec 2017 23:13:16 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 BF32D2D4C5 for ; Wed, 27 Dec 2017 23:13:15 +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=oIysSrKcJbKiiWsR2fhX90OoI96W6VNTpS7szPlRgTE=; b=Iv729ol3DCl3NKDGw15QWwZsA9 yQj803D44nNXKj9l1BnZ1NcN4n1cNliDtGADm8jSXcn+BCj5NQtdZqurSW2q8aVUSQvNzf2gtFZxv 8U8tKV3Fy+XkBj7zbXKRGYqFGMH4AcK52KsQlCSBgDc6N3MbBr4g4acxyCFntm7IeZYf44zf61af2 mHMDTUOOOznnCRbUs7Bw/YTGOnPwmIgHDQwvQj3ygrl5GxWXz1U8IeS7Snmj5Fl4sKZ281Hm0dc8q uBUwMEBV6SijRYal0FeEZtFuBd/AZ89nM73SSB20e8DFAv4hDYVpOtC3y86kGBQhZCSuB47R3s1Sv Di5Kfvwg==; 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 1eUKsg-0006UO-LD; Wed, 27 Dec 2017 23:13:02 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eUKgr-0004by-Vx; Wed, 27 Dec 2017 23:01:21 +0000 Received: by mail-pf0-x244.google.com with SMTP id e3so20271928pfi.10; Wed, 27 Dec 2017 15:00:39 -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=Mi0DdzbmuXMlQvYDKZvK8yv8N+YDIgRpxxTri98UWnA=; b=ryfkTctBWDa1iV3kAffJNMJXFvkHrzhovTOtaLPXtuFDLfxyXoMY4GyI2U8iZ+15S/ uMvxvaJZkcWMwoMqO6TM2R/Uwnle//zYtcwZILUmgSmBtv7P3LOhZtOqktWK5ukj4RVD wBuBWm+PLt0JFQt6YpFV/I3PsN82seMhPXGaG7IA1Cyc3AZug4V3qRec+e+eBRyoEzLC BWIqz8wdljNyY9RW5gQsAZgiet1d0ueR7IGf91WeUem77XFUsXogngzyWIETxULZgN53 576iFVTGkLvXxh/TQz8FPJYOmUnZk6Q/KC4SWCT2mytXfoa1JNg+8eIChplSgloRrqJK wZ6g== 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=Mi0DdzbmuXMlQvYDKZvK8yv8N+YDIgRpxxTri98UWnA=; b=JJM0hXEzYr5HMuVYQKWhu8tMlXKYJbiESs70WA36FyA7Y/0QsEp68mFwePhlpt8OY0 QYicRsDAXlnSrWphu9SBx3LLmX80NiVUDWCMh1MlQ7MpqqzCixB5TawWo2/ksDunv6TY 7aqvHH2oaRRNYxurVFJoUwPChlcoGhh/bfkKL2bwIm/U3uI0dxzF0OYBVbXy5fbJjYQ4 ZzyQivNQi7BP1knczKsKEab0hSVux1bDYl7dP3ryVVDm0gzLXpaObIAe44wkyqyua1M6 wuaFhb+RUPfrC/MSh16beX6EmMnQrwrOTgzMM7auda6bw9NmA+97Uf+2vod5xMQkrPxx HQ0g== X-Gm-Message-State: AKGB3mJ5hg1gUFO2k3hwyi+wuYVua/qQdQbeIHdzWbNHfduSY9jVoWRy FYuYFlivPg+uheQvIiBsWwo= X-Google-Smtp-Source: ACJfBos0kFZ3eOrfQttjso78PW6Q5ViFl20KPceheFRp4YGRzrAKP5/4Yv34mdIFUgQ+F/QzvNi9Hg== X-Received: by 10.98.233.12 with SMTP id j12mr29354791pfh.157.1514415638763; Wed, 27 Dec 2017 15:00:38 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id l19sm27810326pgc.57.2017.12.27.15.00.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Dec 2017 15:00:38 -0800 (PST) From: Andrey Smirnov To: Srinivas Kandagatla Subject: [PATCH 16/20] nvmem: rockchip-efuse: Make use of of_device_get_match_data() Date: Wed, 27 Dec 2017 14:59:52 -0800 Message-Id: <20171227225956.14442-17-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171227225956.14442-1-andrew.smirnov@gmail.com> References: <20171227225956.14442-1-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171227_150050_826311_994B2295 X-CRM114-Status: UNSURE ( 9.44 ) X-CRM114-Notice: Please train this message. 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 , Joachim Eastwood , 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: Joachim Eastwood 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 d6dc1330f895..979ba0a376a0 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -193,11 +193,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; } @@ -218,7 +218,7 @@ static int rockchip_efuse_probe(struct platform_device *pdev) efuse->dev = &pdev->dev; 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);