From patchwork Mon Jun 3 15:50:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 165640 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4646297ili; Mon, 3 Jun 2019 08:53:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBx+lywgaJZQ1YvU34olss0hNocNL6CtAtRTxn/AsQ2+RIFXvF8E9PUBSU9UC7XVnpB/g3 X-Received: by 2002:a17:90a:b909:: with SMTP id p9mr10181682pjr.74.1559577208037; Mon, 03 Jun 2019 08:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577208; cv=none; d=google.com; s=arc-20160816; b=UuFjMrTnn8709Nn3cg+BpRkwhgcPBNY2+gPpximlfZH/TlByv4WjB2wXNPTGduoBW4 RXG39AWD75ofCZJAVd9iKbG/gVheoPZL1TcTYujf3AfXYZ3wC9+1qWV8G0GCEkfRJGIL WbzoZ2ULVdUMtRGkYW6SJF0rKh4+SX/z1ewc7xhkgoIfSKIhpi35ZlM4dqbrmd8cikkW xbbzYB7EusHM32WzyOm3eJfWQ49ISfcTfBV3C8C8/GAjjKZgwwmir5tlnQfvf8rfYhSB 2qVT8f6ZgGmoCHZqBHPpjOEV9w5KV/eByH7y3YmiqAH/nRZkh0Rx/lf+ZJ27vsZkXi8z HgDw== 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; bh=oDH6+psSYbbFZHkkzcDWu/GMuFXrcRVOA6fC2NbfmHk=; b=wQAnnv1B43u6IB67vw8/+6k2ibPe64BrsQyCMH/Y+IwLmHfjRztWedK7xUY9Sg8onj mtF9S9sALqyVyingtpUs0z/M0JVyppXYXqsKIsqZYmrAjbzL8+BuXQRa7K0dEKQYVZa9 QyGlRB3th71n2i34/8zC8E4J5yEwguav8FupN9pl/4vnynsZX/IISE8toJCFtuK1jAzG shreWSball9I7xObeenopRPysrjUcy6LyDi1RkVwfc9AriGSiZpnryY3X6hl2ZxiXzy9 GHtlf1N0hfbcVYWFq2uPVMCEOo6lNV//FB5hsfzB9iTAE49xOSOI3cu6t1izls+31IdZ E+8g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h187si21804126pfb.129.2019.06.03.08.53.27; Mon, 03 Jun 2019 08:53:28 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729683AbfFCPxZ (ORCPT + 30 others); Mon, 3 Jun 2019 11:53:25 -0400 Received: from foss.arm.com ([217.140.101.70]:53956 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729463AbfFCPwA (ORCPT ); Mon, 3 Jun 2019 11:52:00 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D92D8169E; Mon, 3 Jun 2019 08:51:59 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E43D93F246; Mon, 3 Jun 2019 08:51:58 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com Subject: [RFC PATCH 40/57] drivers: spi: Use class_find_device_by_of_node helper Date: Mon, 3 Jun 2019 16:50:06 +0100 Message-Id: <1559577023-558-41-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> References: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the generic helper to find a device matching the of_node. Signed-off-by: Suzuki K Poulose --- drivers/spi/spi.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 5224ded..e1295e9 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -3549,21 +3549,14 @@ EXPORT_SYMBOL_GPL(of_find_spi_device_by_node); #endif /* IS_ENABLED(CONFIG_OF) */ #if IS_ENABLED(CONFIG_OF_DYNAMIC) -static int __spi_of_controller_match(struct device *dev, const void *data) -{ - return dev->of_node == data; -} - /* the spi controllers are not using spi_bus, so we find it with another way */ static struct spi_controller *of_find_spi_controller_by_node(struct device_node *node) { struct device *dev; - dev = class_find_device(&spi_master_class, NULL, node, - __spi_of_controller_match); + dev = class_find_device_by_of_node(&spi_master_class, NULL, node); if (!dev && IS_ENABLED(CONFIG_SPI_SLAVE)) - dev = class_find_device(&spi_slave_class, NULL, node, - __spi_of_controller_match); + dev = class_find_device_by_of_node(&spi_slave_class, NULL, node); if (!dev) return NULL;