Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3204086pxf; Sun, 21 Mar 2021 23:53:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPUb8CVa+XEexx4y93yAu8QuPklCvAT4VWhXyKgetRpNz0xYqvQMkqsMlj9E0FPL7nwIeR X-Received: by 2002:a17:906:d8c6:: with SMTP id re6mr17143930ejb.311.1616395991254; Sun, 21 Mar 2021 23:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616395991; cv=none; d=google.com; s=arc-20160816; b=w41BjAqoLwN0F80oUK21kESC8GWQnPZp0diXsg8QIQ1Sk4NmA8r7E92rj/N3vCmDFR KJWcjdvaKFJOiIp+oMa7abXObY8I0c1ZS7Y+RPoxFacI646YQOPEg1raNtRuFuygwtUW AvZmxhoGNTu5m6SQEWdJLOoNID66ys+mOAZQ86l21Z5B1ZGpdXzSsVxxB/hDymauab9a Ey05vItcoFFARTD2XGi6efzZUJlBvCYT1z981mrl+Aj9f6Odhl1/b2xSxk+uHNlNylUB kMSqB35u5LjKtaBOa8qdekF5qzrsIOuifvDyPi2Ll7+RGoHUbU1T6y1szsw8dTF/74e3 /duQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=1jzOgOhFx7/oysNzplBrGPPKk27JnilcEtuuD1UUOBM=; b=fD6BGmG4g3qk/7jB/O9j25M9yq0pHov1bLsgsXP5wkO+DzVcaqwTsYieNOMhiAPOmM zg8Kpi0whWeWvOLEpOPfT4jhFMAtHBBhL57GhoODqxHFpQBWb2X7VbYh1ZJWIe4I1ARb N/M31LnZFsWXBLyI5/xLfcpVjgqsE6LShqKB3V4eMRpYWgPofLd9hNtZIpum+J2a7TY2 x/yzotXCpmfc+7Dq11PNN/NTgw5YF7omzApB8QvGPA44aDfOMqD8tMIwlXLaoBW2d4dS KBi74ppaXsnYzCVRioszldeTcsv0GNZdl3uBSNX3E5/SFQ67h+jUHrFXCMcpOuarxGeQ xnBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si10654922ejy.207.2021.03.21.23.52.40; Sun, 21 Mar 2021 23:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229692AbhCVGvt (ORCPT + 99 others); Mon, 22 Mar 2021 02:51:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14052 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbhCVGvT (ORCPT ); Mon, 22 Mar 2021 02:51:19 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F3lTD1FT1zNpsw for ; Mon, 22 Mar 2021 14:48:48 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Mon, 22 Mar 2021 14:51:15 +0800 From: Tian Tao To: CC: Subject: [PATCH] hwrng: omap - Use of_device_get_match_data() helper Date: Mon, 22 Mar 2021 14:51:51 +0800 Message-ID: <1616395911-36618-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use the of_device_get_match_data() helper instead of open coding. Signed-off-by: Tian Tao --- drivers/char/hw_random/omap-rng.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index 4380c23..cede9f1 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -377,16 +377,13 @@ MODULE_DEVICE_TABLE(of, omap_rng_of_match); static int of_get_omap_rng_device_details(struct omap_rng_dev *priv, struct platform_device *pdev) { - const struct of_device_id *match; struct device *dev = &pdev->dev; int irq, err; - match = of_match_device(of_match_ptr(omap_rng_of_match), dev); - if (!match) { - dev_err(dev, "no compatible OF match\n"); - return -EINVAL; - } - priv->pdata = match->data; + priv->pdata = of_device_get_match_data(dev); + if (!priv->pdata) + return -ENODEV; + if (of_device_is_compatible(dev->of_node, "ti,omap4-rng") || of_device_is_compatible(dev->of_node, "inside-secure,safexcel-eip76")) { -- 2.7.4