From patchwork Mon Jun 3 15:50:01 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: 165642 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4646420ili; Mon, 3 Jun 2019 08:53:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7fcL167iRBAYDhc64KD701Vif3ZkNC9r9Wgj9LbVe+YUtBx+d3SP4a1dyqbVOXyBusXvQ X-Received: by 2002:a62:fb0a:: with SMTP id x10mr9371544pfm.224.1559577215866; Mon, 03 Jun 2019 08:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577215; cv=none; d=google.com; s=arc-20160816; b=fEv4bNbYpVjvliItdyshaGD0Dd97A6EV5hHhgpgUPq8kt+4cmRuEraQZmNdvJf4rMa bdTPjT3e8NBSyxI65mgm6v/ooK5PuXaQbaWOcv+i3oVa8GIOTkCN+G9jkSLkoLcR++F0 UuBMUwoRaqcC11fcHNqaNsKEUH41hE+U2whhqAmdwNnFAi+YZbemA6NlopJit0JMoKAB w1nIqJ+GYih0UFUCXm3S/M0Idl4qxjLSjEyk3mcAATbnYSbwadvuw2p8XJ35+0BU5AMV D0OYuR7aG1sRGytbz9wDGsanT2CPHKW7APp9Po17gju7NJhQTF40ttNzTu8tuBlZbba3 ovhA== 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=11QtoEOFz87RuSj89nBcIUOrDHztUbI8qjUp2dMoYcM=; b=zOX0YPg/kTwj7mNKfYJNMxsO3XarKo/m1Wr671WWxndSYoZnpm7aVKCoJL2eum80VR t7HiJIPRRRGkOx2sUZEDtH410Ku+yYJ0Zp2k3VtjTGgVt9FTGUECoDClfP2dND+j9/QE X1GpCmt4SeHun7FMYIz1uOjMLeko/zuP7IvbU2Ey5+1U10dNNbJPSJb0bWlmUhHeR3ei +MZdPL73QjMIA5Hyqd3bMrrrPp7FMGYwsXQ5gXznkO/o+H4DROQ/b2OTh2pZ7zSPro77 Tca/Ie3J0qV1NeV8abQ2NnYOv6Gpw7BQyGiT0orb5CvOz+s4kv6iiNJelSRAH2pOwG6M eIFg== 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.35; Mon, 03 Jun 2019 08:53:35 -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 S1729441AbfFCPvz (ORCPT + 30 others); Mon, 3 Jun 2019 11:51:55 -0400 Received: from foss.arm.com ([217.140.101.70]:53900 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729400AbfFCPvx (ORCPT ); Mon, 3 Jun 2019 11:51:53 -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 BDB521A25; Mon, 3 Jun 2019 08:51:52 -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 C8F323F246; Mon, 3 Jun 2019 08:51:51 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com Subject: [RFC PATCH 35/57] drivers: core: Reuse generic match by device type helper Date: Mon, 3 Jun 2019 16:50:01 +0100 Message-Id: <1559577023-558-36-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 match the device type of a given device. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Suzuki K Poulose --- drivers/base/core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/base/core.c b/drivers/base/core.c index 731baac..69cba57 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2839,13 +2839,6 @@ struct device *device_create_with_groups(struct class *class, } EXPORT_SYMBOL_GPL(device_create_with_groups); -static int __match_devt(struct device *dev, const void *data) -{ - const dev_t *devt = data; - - return dev->devt == *devt; -} - /** * device_destroy - removes a device that was created with device_create() * @class: pointer to the struct class that this device was registered with @@ -2858,7 +2851,7 @@ void device_destroy(struct class *class, dev_t devt) { struct device *dev; - dev = class_find_device(class, NULL, &devt, __match_devt); + dev = class_find_device_by_devt(class, NULL, devt); if (dev) { put_device(dev); device_unregister(dev);