Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754590AbbBJJ7n (ORCPT ); Tue, 10 Feb 2015 04:59:43 -0500 Received: from mga02.intel.com ([134.134.136.20]:61222 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752640AbbBJJ7k (ORCPT ); Tue, 10 Feb 2015 04:59:40 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,549,1418112000"; d="scan'208";a="649957060" Date: Tue, 10 Feb 2015 11:59:32 +0200 From: Mika Westerberg To: "Suthikulpanit, Suravee" Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , "lenb@kernel.org" , "hdegoede@redhat.com" , "tj@kernel.org" , "arnd@arndb.de" , "mjg59@srcf.ucam.org" , "grant.likely@linaro.org" , "hanjun.guo@linaro.org" , "al.stone@linaro.org" , "graeme.gregory@linaro.org" , "Duran, Leo" , "linux-ide@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linaro-acpi@lists.linaro.org" , Lv Zheng Subject: Re: [V3 PATCH 1/2] ACPI / scan: Add support for ACPI _CLS device matching Message-ID: <20150210095932.GN1480@lahna.fi.intel.com> References: <20150209111538.GB1480@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2053 Lines: 50 On Mon, Feb 09, 2015 at 09:02:11PM +0000, Suthikulpanit, Suravee wrote: > On 2/9/15, 19:15, "Mika Westerberg" > wrote: > > >On Mon, Feb 09, 2015 at 12:02:43AM +0100, Rafael J. Wysocki wrote: > >> On Monday, February 09, 2015 12:20:03 AM Suravee Suthikulpanit wrote: > >> > Device drivers typically use ACPI _HIDs/_CIDs listed in struct > >>device_driver > >> > acpi_match_table to match devices. However, for generic drivers, we do > >> > not want to list _HID for all supported devices, and some device > >>classes > >> > do not have _CID (e.g. SATA, USB). Instead, we can leverage ACPI _CLS, > >> > which specifies PCI-defined class code (i.e. base-class, subclass and > >> > programming interface). > >> > > >> > This patch adds support for matching ACPI devices using the _CLS > >>method. > >> > > >> > Signed-off-by: Suravee Suthikulpanit > >> > >> Greg, Mika, any problems with this? > > > >Is there some specific reason why this cannot be done in similar way > >than PCI already does? > > > >In other words, stuff _CLS fields to struct acpi_device_id and make > >match functions match against those if they are != 0. > > That was my original thought. Then I realized that the acpi_device_id is > used > to create the device matching table, in which could contain several > _HID/_CID. > However, most of the added _CLS field would likely ended up being unused > and > taking up space. Well, PCI is doing that already :) > In contrast to _HID/_CID, a driver is likely to match just a single _CLS. > So, I think it is cleaner to have just a dedicate struct acpi_device_cls, > and > a matching function for it. IMHO cleaner version is the one following PCI. Besides, how do you support modules with this? Or did I miss something? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/