From patchwork Mon Jun 3 15:50:02 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: 165644 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4646508ili; Mon, 3 Jun 2019 08:53:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNkekMfJ56MO7QhXRXoQsrQ2ERmB6U1pmVyqDBltOz2t2KDwYqQGVN2xTRqNJfensk0PiF X-Received: by 2002:a17:902:24b:: with SMTP id 69mr30640616plc.255.1559577221515; Mon, 03 Jun 2019 08:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577221; cv=none; d=google.com; s=arc-20160816; b=RD0jTf50v9IXcMXNuWBCdZrLPk8C70lAzCJMQdPB05P3N5PGHHPQpVZvIhSAVgNHIK B3bk8NXcgBdvXWBQoP4f7/EhSUhc+I6y7b4cauj1zhrJyCGPwh5nzsHz1uQiJe5Pf+Fn tX0iYwWmZueItNQ1M42er75FY8styG4ZSo7rh0XBxl+VtDEuTwp/wvCfXA6W3hI2z4Vm K7FhJw8t104s9b7ZthfWlK/0zmgVqY/uZskla985/4qKcotezQ6j+NPDQgegL103Vtmz 4ZoGIQLTjjP2/wpdXdy2X+hG+ULJJLyN6U3gOAMBMrGaH8M8vkejxSzVxYHXAAlrzjWb BUNw== 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=/V2EVnxYD7YVqjJ8oELaZhlqmh5BZiS//pdTTDVuccg=; b=qLAgvT+dFjSyIh+2ETPOq/lEucz7HbuuT2EFhrQNLpCyMESP1gn+2P6bZBoIV2mBMa jTwMQN9Z2f4FeJmPhb3YwZPTcyXk9tvNDvu4FLuh/ibMr9vhPqLna71BJLQlf6LzUcGi b2386iDDIUpld8h3eVCvy5Rm2xKFu6NVdbrL6j3mgrGkqKlFyyquMDJBETqPVe7OlBQf druPwJSvtRx1hV9N+9HCYReTq2W8yxyFQ+3hQjcnUxEBbeHchVcIh1GA7xkphIhaRUYQ J5Xr0aPmpi3qFyglEv4BWm9CuWHNc4cWK/vIXP4kWwX+oiIPWhDLFX4kjIGLFWLVrQpL uVCg== 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.41; Mon, 03 Jun 2019 08:53:41 -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 S1729700AbfFCPxk (ORCPT + 30 others); Mon, 3 Jun 2019 11:53:40 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:53906 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729426AbfFCPvy (ORCPT ); Mon, 3 Jun 2019 11:51:54 -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 42D101AED; Mon, 3 Jun 2019 08:51:54 -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 06C723F246; Mon, 3 Jun 2019 08:51:52 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, Tomas Winkler , Arnd Bergmann Subject: [RFC PATCH 36/57] drivers: mei: Use class_find_device_by_devt match helper Date: Mon, 3 Jun 2019 16:50:02 +0100 Message-Id: <1559577023-558-37-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 Switch to the generic helper class_find_device_by_devt. Cc: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Suzuki K Poulose --- drivers/misc/mei/main.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index ad02097..243b481 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -858,13 +858,6 @@ static ssize_t dev_state_show(struct device *device, } static DEVICE_ATTR_RO(dev_state); -static int match_devt(struct device *dev, const void *data) -{ - const dev_t *devt = data; - - return dev->devt == *devt; -} - /** * dev_set_devstate: set to new device state and notify sysfs file. * @@ -880,7 +873,7 @@ void mei_set_devstate(struct mei_device *dev, enum mei_dev_state state) dev->dev_state = state; - clsdev = class_find_device(mei_class, NULL, &dev->cdev.dev, match_devt); + clsdev = class_find_device_by_devt(mei_class, NULL, dev->cdev.dev); if (clsdev) { sysfs_notify(&clsdev->kobj, NULL, "dev_state"); put_device(clsdev);