From patchwork Mon Jun 3 15:49:58 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: 165619 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4644667ili; Mon, 3 Jun 2019 08:51:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEFfqWXSX6GpQK+oGK+0a0o0OL7T5ACbKNnRr45/EMhRcGX7kRYdwoW/t1g2+dC/c8ag8/ X-Received: by 2002:a17:902:8f87:: with SMTP id z7mr5304437plo.65.1559577113291; Mon, 03 Jun 2019 08:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577113; cv=none; d=google.com; s=arc-20160816; b=dK7HaYrOMqEj0sTfPqVjRmbacjCYCQgqIcIOLNdz4gtJR8K8VIYI+fmsLkdssOtZMy 5XK3Um/BgG0Id4gaiYr9PtslQIMyxHzd55FizJSbj5f9tMBVZe61OJhfE3vOFmPDMS3R ruHDW8Z+rSZUuzv6TKVIIZ8ucXrCwSQf6y9cSQyl1qMjgtbJlgdPEhxxvOasD3rLnMVJ OgkvpQMU+RC+Tr5J2JxyoLod4Tzqi7x8xhK0Nqno1S0pbzb/sGA1BCgGTOD06qJY1hhV yZQQ7mZPFY/tildfMz0dZWXr5F+r9JfrS+yV6nZBPp12NjRCYQUjbw7jqx/nGcFXDO1o SeFQ== 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 d27si19408244pgl.202.2019.06.03.08.51.52; Mon, 03 Jun 2019 08:51:53 -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 S1729424AbfFCPvw (ORCPT + 30 others); Mon, 3 Jun 2019 11:51:52 -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(-) -- 2.7.4 acked-by: Harald Freudenberger 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; }