From patchwork Mon Jun 3 15:50:14 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: 165634 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4645616ili; Mon, 3 Jun 2019 08:52:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyC0JAlf3VRUpkbF1EzTFHcaR2BmU2t/ZIsyf+kW+tjko9XDmY0U2XWoFLym2PjN6JW3d8A X-Received: by 2002:a63:81c2:: with SMTP id t185mr29775093pgd.257.1559577168045; Mon, 03 Jun 2019 08:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577168; cv=none; d=google.com; s=arc-20160816; b=BIbIFsVEQN7kcPwBxq/+fL+1znj5hgJR3jhaRORfz3uwExCEugDMvSHJdEAPObYxEp UHafGzBrfPtEdISuo1Ck74dmqMbheN3Ytykg7bEQuJYJQrOmyQLZOEJnt9BS9rm7g5kD 2wMgwS+UjG3xwgaXbah7WgvUFL3i+fT5+OoSySgYSSxtK2xHM81rlUJ7LXBScYeWSQxx XGhxhFrktKnZv4rKajTnT+Rj73kmFMcA2v3nNkPqLPAt8dyxYsbfJdceQj6FcFpQLIrT 3W8acWUwddV8/JK8YDuu3vy7MHBEJezAImg3zmto8nV2SjNEvp8z36ZKi2dNTM485bwp HiHQ== 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=I+cgjBFwJLXgQbap6M5q0m9ioMXcRce5kCGzz/ag/HU=; b=FNBkHcU028eKlcI8j9aO7Z3G1qJwVQI3U4mPhrfJNFNSCePf5qkPi+YSCJ01ldHmnX sqbCvyBNWV3rZHF3wXFGnasShCaOXBgW52fA+BCc3HhOfvN7WttyREIGjsG4nrNsv9EM uNdgLBxh9ix1Oy1vMBiVM+EdXBVvNbMfC529EJ5qw/vWx7wJtIb3u9Hx5XSJOx9Ff8ji hN8EoOHNNjd0N93DYc+asRfxfRUSZiEK6zGk/XAc7a7sbgdjf9dDJPEp68XoA2jKieBw obNgsAIvNQxibA6IB/YnoIXkt/MOM/wZ8mb8UZy201GUOdjEusiP44YRgdLEtlOYWPE9 DSyw== 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 l3si3193510pgl.560.2019.06.03.08.52.47; Mon, 03 Jun 2019 08:52:48 -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 S1729575AbfFCPwS (ORCPT + 30 others); Mon, 3 Jun 2019 11:52:18 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54048 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729544AbfFCPwN (ORCPT ); Mon, 3 Jun 2019 11:52:13 -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 08C7715AB; Mon, 3 Jun 2019 08:52:13 -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 A3FD63F246; Mon, 3 Jun 2019 08:52:11 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, Peter Oberparleiter , Martin Schwidefsky , Heiko Carstens Subject: [RFC PATCH 48/57] drivers: s390: cio: Use driver_find_by_name() helper Date: Mon, 3 Jun 2019 16:50:14 +0100 Message-Id: <1559577023-558-49-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 driver_find_by_name() helper. Cc: Peter Oberparleiter Cc: Martin Schwidefsky Cc: Heiko Carstens Signed-off-by: Suzuki K Poulose --- drivers/s390/cio/ccwgroup.c | 10 +--------- drivers/s390/cio/device.c | 17 +---------------- 2 files changed, 2 insertions(+), 25 deletions(-) -- 2.7.4 diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index c554f16..b1e24fb 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c @@ -606,13 +606,6 @@ void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver) } EXPORT_SYMBOL(ccwgroup_driver_unregister); -static int __ccwgroupdev_check_busid(struct device *dev, const void *id) -{ - char *bus_id = id; - - return (strcmp(bus_id, dev_name(dev)) == 0); -} - /** * get_ccwgroupdev_by_busid() - obtain device from a bus id * @gdrv: driver the device is owned by @@ -629,8 +622,7 @@ struct ccwgroup_device *get_ccwgroupdev_by_busid(struct ccwgroup_driver *gdrv, { struct device *dev; - dev = driver_find_device(&gdrv->driver, NULL, bus_id, - __ccwgroupdev_check_busid); + dev = driver_find_device_by_name(&gdrv->driver, NULL, bus_id); return dev ? to_ccwgroupdev(dev) : NULL; } diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index a5c2765..262e81c 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1649,20 +1649,6 @@ int ccw_device_force_console(struct ccw_device *cdev) EXPORT_SYMBOL_GPL(ccw_device_force_console); #endif -/* - * get ccw_device matching the busid, but only if owned by cdrv - */ -static int -__ccwdev_check_busid(struct device *dev, const void *id) -{ - char *bus_id; - - bus_id = id; - - return (strcmp(bus_id, dev_name(dev)) == 0); -} - - /** * get_ccwdev_by_busid() - obtain device from a bus id * @cdrv: driver the device is owned by @@ -1679,8 +1665,7 @@ struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv, { struct device *dev; - dev = driver_find_device(&cdrv->driver, NULL, (void *)bus_id, - __ccwdev_check_busid); + dev = driver_find_device_by_name(&cdrv->driver, NULL, bus_id); return dev ? to_ccwdev(dev) : NULL; }