From patchwork Mon Jun 3 15:50:15 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: 165626 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4645058ili; Mon, 3 Jun 2019 08:52:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFcVZ9kRnD2gZv+tLEThvbv967DNyyXSvXROvpOczeFrD+u6qQIIIXnwpxIXOaf/QO5hdC X-Received: by 2002:a62:1483:: with SMTP id 125mr32197089pfu.137.1559577138415; Mon, 03 Jun 2019 08:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577138; cv=none; d=google.com; s=arc-20160816; b=TmjR692AogUiWPqq5TbMfeYxJtecs+AqAkSum2xrplpSTeEnEOSp/8qyYq1KZvm/za HPYtHFmH3cDgotBVfVDxQJvgsISwCxzJakod3DD5vCfjMudJ0Z6sn6aQ1TGtwwMoxKWn ZbIsI8sqjXthGkPX5M9zQuJqlalbgYa4FCVlpULyd0cT38pNSk0W9+XYse3z+TmK3c/4 ZS03TTanKWgHVLzJXAKQ4WbADUx9Mbx8ORc5LFiepFub4hwj/KOLcZaGHT/87nqhtUTl n+r8mWrXlFErEzEfGQaJfhUG9k1+Jc0poveXQqXEuSRuLwkICEQ47arxHs4MplHIZ+ft lvCg== 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=3Vj7ifkAUHf6AEMPNeObfCtHupz4v40NuVs7nu+hhK4=; b=p/A0zzg1F78wGtq0Fc8brCVeoZi+1py1/I/61qwRXk/44laYUhavnzIKAnbLjMAKxu qQ/MJbHXQC8cqLpFiqhFfo2FlvgD2LjukhoLthWNmugy+XOUWcbKnG/70O3O+ju7Nf42 F9tZIyJi5dDubzadhHUNX7v9qtYgGG0Cr1luVf14LDVXzcYB8zbw9nV3/5xvrBzdYdaH KDwN1LoCocCs3P1jbi01lnweIxc3ibIFKrB/8dpit1BD33rvwm6OyxGfyj+W+Pyqh5gp kogHbGl5eMyZ/mTl0QVNg/lJ2zwbLaPwxomimnMFlsbB2e2AHfMiIslAwb88oUDSP1np UpEQ== 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 h4si17718022pgs.269.2019.06.03.08.52.18; Mon, 03 Jun 2019 08:52:18 -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 S1729563AbfFCPwR (ORCPT + 30 others); Mon, 3 Jun 2019 11:52:17 -0400 Received: from foss.arm.com ([217.140.101.70]:54058 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729531AbfFCPwO (ORCPT ); Mon, 3 Jun 2019 11:52:14 -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 78C51169E; Mon, 3 Jun 2019 08:52:14 -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 45D393F246; Mon, 3 Jun 2019 08:52:13 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, Thor Thayer , Lee Jones Subject: [RFC PATCH 49/57] drivers: mfd: altera: Use driver_find_device_by_of_node() helper Date: Mon, 3 Jun 2019 16:50:15 +0100 Message-Id: <1559577023-558-50-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 new helper to find device by of_node. Cc: Thor Thayer Cc: Lee Jones Signed-off-by: Suzuki K Poulose --- drivers/mfd/altera-sysmgr.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.7.4 Acked-by: Thor Thayer diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c index 2ee14d8..1fbe06c 100644 --- a/drivers/mfd/altera-sysmgr.c +++ b/drivers/mfd/altera-sysmgr.c @@ -88,16 +88,6 @@ static struct regmap_config altr_sysmgr_regmap_cfg = { }; /** - * sysmgr_match_phandle - * Matching function used by driver_find_device(). - * Return: True if match is found, otherwise false. - */ -static int sysmgr_match_phandle(struct device *dev, const void *data) -{ - return dev->of_node == (const struct device_node *)data; -} - -/** * altr_sysmgr_regmap_lookup_by_phandle * Find the sysmgr previous configured in probe() and return regmap property. * Return: regmap if found or error if not found. @@ -117,8 +107,8 @@ struct regmap *altr_sysmgr_regmap_lookup_by_phandle(struct device_node *np, if (!sysmgr_np) return ERR_PTR(-ENODEV); - dev = driver_find_device(&altr_sysmgr_driver.driver, NULL, - (void *)sysmgr_np, sysmgr_match_phandle); + dev = driver_find_device_by_of_node(&altr_sysmgr_driver.driver, NULL, + (void *)sysmgr_np); of_node_put(sysmgr_np); if (!dev) return ERR_PTR(-EPROBE_DEFER);