From patchwork Mon Jun 3 15:50:03 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: 165639 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4646288ili; Mon, 3 Jun 2019 08:53:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEEw8VIp6ekDPGd4DF0gr/FNO4/KYfAH5ujIuLMBlLfUD7WIw9jiKHnrHQdTfthEU+Ezw8 X-Received: by 2002:a65:60d2:: with SMTP id r18mr29137962pgv.217.1559577207646; Mon, 03 Jun 2019 08:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577207; cv=none; d=google.com; s=arc-20160816; b=kTt/ENNWxyA3wT2obaDinljB0p1F6EFDDZ4n0iBk7BArevXtJIPPvbeLpL5aVIDfK4 jQzaqcvKt0aMgbSIbiBCJLX3bTSwNmeeG5axa7V2MJHBkpd2BdStdoJLPHQIQjqeL+VN 0hxDnbIABb5B1NmefHXrC8m3U2JVa0OZlTX0DyfiZa+VQH0D8TXP6GUlx4m1x8ueihok yCY6yKZ+gjjiJcDHHKV6CLbHA1zY1njFZKkR4RkC3Az+E4WsgUEXYgiGs65bdovB9dKd Ew+UQgnlMh4PHmN5rIKH5rXJBmve6utASlyuie5FAw46f8DXHXAMF3fxWRL3ywhQSGtD Rvkg== 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=K+4tZquMCc4TbINLmytATDuZLBSZX6KZRG+TI08EOuI=; b=QWikMtDfzy1St1IISZWSFbrG73zhMf6V5dbFAFU/1HND8teTazAE6vns//GJJQDZAx +NaOLdaTKvP4O9bvmrdqE1Q6o2IfiGYq/uwOjMcH+Pw+D5BbV7DmFERmbX1Q8s0Tllf3 CxH5Yv+KhtQ4s87eAKvRFp2XkCl8vMh6xdM+1SgJ8lHGL8eMueIOi996z5JVadLaIYdQ SbKS9i9tjvCxEBnJ89KFDz+4/MAIZRDOjdbSEb/q+wMD15kWzQLsmITvF3QNvTkA279K brU9GccNK7fezNPmeQDp3bzmbBKB6e4GycxHx7MFg+GlCQvwfDDzEtvhDPxeqNgSyXjn g8+Q== 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:27 -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 S1729467AbfFCPwA (ORCPT + 30 others); Mon, 3 Jun 2019 11:52:00 -0400 Received: from foss.arm.com ([217.140.101.70]:53920 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729440AbfFCPv4 (ORCPT ); Mon, 3 Jun 2019 11:51:56 -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 B31AC169E; Mon, 3 Jun 2019 08:51:55 -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 7FFA53F246; Mon, 3 Jun 2019 08:51:54 -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 , Heiko Carstens Subject: [RFC PATCH 37/57] drivers: s390: zcrypt: Use class_find_device_by_devt helper Date: Mon, 3 Jun 2019 16:50:03 +0100 Message-Id: <1559577023-558-38-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 devt. Cc: Harald Freudenberger Cc: Heiko Carstens Signed-off-by: Suzuki K Poulose --- drivers/s390/crypto/zcrypt_api.c | 11 +---------- 1 file changed, 1 insertion(+), 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 16cad8e..99c9b77 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 devt value for find_zcdndev_by_devt() */ -static int __match_zcdn_devt(struct device *dev, const void *data) -{ - return dev->devt == *((dev_t *) data); -} - /* * Find zcdn device by name. * Returns reference to the zcdn device which needs to be released @@ -159,10 +153,7 @@ static inline struct zcdn_device *find_zcdndev_by_name(const char *name) */ static inline struct zcdn_device *find_zcdndev_by_devt(dev_t devt) { - struct device *dev = - class_find_device(zcrypt_class, NULL, - (void *) &devt, - __match_zcdn_devt); + struct device *dev = class_find_device_by_devt(zcrypt_class, NULL, devt); return dev ? to_zcdn_dev(dev) : NULL; }