Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833AbeACUC6 (ORCPT + 1 other); Wed, 3 Jan 2018 15:02:58 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37103 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbeACUBl (ORCPT ); Wed, 3 Jan 2018 15:01:41 -0500 X-Google-Smtp-Source: ACJfBosQxp+8nSz0/A9d2dU1WNr6LK3JqvNqmkpA9Lg+s/dYeLN9IhKHLGkLXhSAK+WkpQ5oNcZnTw== From: Andrey Smirnov To: Srinivas Kandagatla Cc: Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 18/22] nvmem: rockchip-efuse: Make use of of_device_get_match_data() Date: Wed, 3 Jan 2018 12:01:10 -0800 Message-Id: <20180103200114.23922-19-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180103200114.23922-1-andrew.smirnov@gmail.com> References: <20180103200114.23922-1-andrew.smirnov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 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); -- 2.14.3