From patchwork Mon Jun 3 15:49:55 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: 165647 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4646754ili; Mon, 3 Jun 2019 08:53:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8qWpY4SBIG7JtNSW1MDb8TM/oq63WEaWj9kojKoc4p6Tb56UgMW7LHPwn/akwB5VsX+cw X-Received: by 2002:a17:902:294a:: with SMTP id g68mr31412581plb.169.1559577237235; Mon, 03 Jun 2019 08:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577237; cv=none; d=google.com; s=arc-20160816; b=bSMznxkRXUAyvdf68tAvipxvXk5fR+xpF2MsDvA/wPWjP63KUBxp7gChiJ4W5m9x2o OHZapS46JIHC7IWY1jW6D5duwg/xCoSA78YmNyBIUP6adzbXFhwJaqwRRx954p11F3Kx qheE+PDm+TLwpYYCv9HksmfCSH4K31RVZ+oGtyD+kqA0sdG43ueKrJlAwkZhcQhqM6CL +61CHCsD0Zo7BVWfaVB6jCxVrbGcaY1Ody9CDQ6EjNWlrp3E984i3pZCNEHlgLoV3GbS sm8vRscrchpd42jkBwZ9mtTmbH9Quxp8v58noXAbcMTzM2jYShd3Y9UaNhIwTmVdHe3f bcQA== 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=u+PPgnXN5Lzrlm9TCw7Gy4cipom2V4cFXyK2ztO81eQ=; b=0+Nvv9o5t79YFMqve8UbSCa/xD/OTy42UK8KbeI0CkClyeeVjuipcB5vR5vxdiOCbO nZqOnbBm8nzPcxLuwTpchkFSRliSMYC5onKPsDlcxgMLo+TPpxdIER6YjM/DKKoh7tCn 05oW8FWnW4anct5YBwQ8JRZv7Jan8Qd8/5XWdmvJyygsf5o9PHWeaNc9mP4lcAY6bf8Z jKRn7i9g6JoXeX1weSWlkcG010pHAMxbse4jM4HpMDNDHjGVWs7uLwGosumB20kfwYkf g5fVB5Sj9ShL7m0O+YI4pAEC2KIrySkncjKdR0yku8s9Krme2qt3Nj6LoJ8oVIv+OJ23 96aw== 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 u126si15462989pgu.117.2019.06.03.08.53.56; Mon, 03 Jun 2019 08:53:57 -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 S1729664AbfFCPxz (ORCPT + 30 others); Mon, 3 Jun 2019 11:53:55 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:53824 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729339AbfFCPvn (ORCPT ); Mon, 3 Jun 2019 11:51:43 -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 69BF31AED; Mon, 3 Jun 2019 08:51:43 -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 2DCE63F246; Mon, 3 Jun 2019 08:51:42 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, Alexander Shishkin , Maxime Coquelin Subject: [RFC PATCH 29/57] drivers: stm: Use class_find_device_by_name() helper Date: Mon, 3 Jun 2019 16:49:55 +0100 Message-Id: <1559577023-558-30-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 class_find_device_by_name() helper. Cc: Alexander Shishkin Cc: Maxime Coquelin Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/stm/core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index e55b902..e110958 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -89,13 +89,6 @@ static struct class stm_class = { .dev_groups = stm_groups, }; -static int stm_dev_match(struct device *dev, const void *data) -{ - const char *name = data; - - return sysfs_streq(name, dev_name(dev)); -} - /** * stm_find_device() - find stm device by name * @buf: character buffer containing the name @@ -116,7 +109,7 @@ struct stm_device *stm_find_device(const char *buf) if (!stm_core_up) return NULL; - dev = class_find_device(&stm_class, NULL, buf, stm_dev_match); + dev = class_find_device_by_name(&stm_class, NULL, buf); if (!dev) return NULL;