Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4313389ybi; Mon, 3 Jun 2019 08:53:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdEcBea/CwQrKbTF30DUPj/6bOzpmd6mk0pzsb9kzXR98hYQonHwcWHyy5Mqvh6hXdkLS5 X-Received: by 2002:a17:90a:f992:: with SMTP id cq18mr30098136pjb.54.1559577223386; Mon, 03 Jun 2019 08:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577223; cv=none; d=google.com; s=arc-20160816; b=Mt4o9kytwZdzV5Y8Fx5LqoK6jEbJzMScl/Clc3W1+hNNm3V3SAahELGbej+xSTMtnt i1/Oau+9nX5GpSy1hJ1OAfqsjPO6bEvJ3QJOdcx364pwJv1mrtfkXw/SjfhLouUrQ6DI qANjcdAlc8zxvTn/izAOb+vZIQIhmPWjU6jEsoNN1hC6OtbzDg8Rt+sdKZWGeTh5HuuM sWo0gQZiFwgp7Qbez+AT2r0ds2UEprk6UFdylxHPKeVxf0qz6bkI4MTXgE9jZRk4REEl ISSvpjpH8bZHPPDfmZXWjzLUPITqV8yH4cMf8B4DM2hJ3RrZMo8+7qlCBsZ/vVNiHX11 v5fQ== 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=dI5Ctw3NuVmRcdBkI8t6OeZVtdXYHroq0OYDfMezdBs=; b=VaXMGcnAfA9fL+kjsMHkeKQAEPml/YZJ1Lgo/bCnCsMGkX22z4eQ66M5otiHlLwhkP IXyu66dJstShLuXaFrcq065AClGrhZT7w5rrWAvKp6JU0+LUlb74zcZAhlf5JRH65sF1 QUdAG6T2Bde5Dwwz8ii962P3s6jbuK31VOpL4qMKS7ZIW9CSYq7sqbs3t9nbijamJgG2 PkID0SJifBMQRa1p8XlGCu59ijgDr5JQX/HfYBYNKiKAsEKGor5hN+/PerZE7QBHMnbI s8KDx+uRdPZtfSk8LAKVU9VaXh2AcRPwALrLiLtlNlPnYWnzg8CC5rkbXz7h0LJ1x52U cIKQ== 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 h9si19851155pjs.74.2019.06.03.08.53.27; Mon, 03 Jun 2019 08:53:43 -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 S1728077AbfFCPvv (ORCPT + 99 others); Mon, 3 Jun 2019 11:51:51 -0400 Received: from foss.arm.com ([217.140.101.70]:53866 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729400AbfFCPvs (ORCPT ); Mon, 3 Jun 2019 11:51:48 -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 732721A25; Mon, 3 Jun 2019 08:51:48 -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 1CEF83F246; Mon, 3 Jun 2019 08:51:46 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, Harald Freudenberger , Martin Schwidefsky , Heiko Carstens Subject: [RFC PATCH 32/57] drivers: s390-crypto: Use class_device_find_by_name() helper Date: Mon, 3 Jun 2019 16:49:58 +0100 Message-Id: <1559577023-558-33-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: Harald Freudenberger Cc: Martin Schwidefsky Cc: Heiko Carstens Signed-off-by: Suzuki K Poulose --- drivers/s390/crypto/zcrypt_api.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 1058b4b..16cad8e 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -133,12 +133,6 @@ struct zcdn_device { static int zcdn_create(const char *name); static int zcdn_destroy(const char *name); -/* helper function, matches the name for find_zcdndev_by_name() */ -static int __match_zcdn_name(struct device *dev, const void *data) -{ - return strcmp(dev_name(dev), (const char *)data) == 0; -} - /* helper function, matches the devt value for find_zcdndev_by_devt() */ static int __match_zcdn_devt(struct device *dev, const void *data) { @@ -152,10 +146,8 @@ static int __match_zcdn_devt(struct device *dev, const void *data) */ static inline struct zcdn_device *find_zcdndev_by_name(const char *name) { - struct device *dev = - class_find_device(zcrypt_class, NULL, - (void *) name, - __match_zcdn_name); + struct device *dev = class_find_device_by_name(zcrypt_class, + NULL, (void *) name); return dev ? to_zcdn_dev(dev) : NULL; } -- 2.7.4