Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp648062imm; Wed, 4 Jul 2018 03:37:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeQu1QqMyKXKpnt70ENWtY4LjTB9lWjjB8pscyPowhZxRYLqk2aWKUHgcEVc/BxeJRiK+YQ X-Received: by 2002:a17:902:7009:: with SMTP id y9-v6mr1538973plk.217.1530700653441; Wed, 04 Jul 2018 03:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530700653; cv=none; d=google.com; s=arc-20160816; b=tLIumzHjbprqGNH/evBkPMzndGQXtCaTSRs40BZEl8lkZ5JCqMBnPxCIH3mMBkhIwz UbI1oU5Go2nlKVxO+6AGtmq8sIQEUPgteQ1r0D8+oeyberrnJw2R9qUhjfT3V+ljW2mH XVkYwTCMJCQH2FUWfJsfoqZBwg5aWNtveI/CILOd0puNfus3kc1scUwNzqqEa4PTBXB7 Ef41qusS+x+8w7dvd5UMclaR2ffpc3a2Q5pzpBi22osxv020+Nc28wjczsX78y3/2RdE ULZN5MPFnGHfU88hw1Wi17GWagmoZ8gQhrzrapoZKl3u2TKS/6ueMTb1GyeabR+YeJby Ir9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Rw30GbvtcIm1GUQdzvA/7DYGLWz5chvWddEClUCty98=; b=It2cpLtZB84sHiCa5FutNnOJ8XBqOCK5MJihf9LGDQhXsaNS5+b3KjcKVWBFlMC4ED TDJ4OUiI7xqIMoWDi9SDbrjCTfdHXgvkczpYjDZdY3908URhPFwYxc3qSInCePm/kpMo wGA56c3VXtfd8UUYGi22j6oCLEtLfWAhGkh1h4s4AvbWoJ86XVjxcVSwGDs2Kp5BY1Cj uXv5DGKCe2gVCz3CvKIus8LMUbluqv+yEy5tKoGJFWmymzNmpSk6bOe6QHXSytFzSvcm wgSK/P+cggL9lghsvRMifY2OIj8cZUrOQivYtquYM3yxu6xL430Hx/VHnt7jhN7MLl8g 9+8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ERKmyB5d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si2814680pgr.208.2018.07.04.03.37.17; Wed, 04 Jul 2018 03:37:33 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ERKmyB5d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933831AbeGDKgJ (ORCPT + 99 others); Wed, 4 Jul 2018 06:36:09 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:32882 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753295AbeGDKgF (ORCPT ); Wed, 4 Jul 2018 06:36:05 -0400 Received: by mail-ua0-f194.google.com with SMTP id g18-v6so3160663uak.0; Wed, 04 Jul 2018 03:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Rw30GbvtcIm1GUQdzvA/7DYGLWz5chvWddEClUCty98=; b=ERKmyB5dqtlMUuGZ7dfJb9UrF7TRJnNZJGHD4GwRo8n2h1+8doKqHVZ3b375tMxr6G uuidtoaf5SKcV+uXsqT00cfDYssroh6Nkbww75KE8lNLJR4mnPmA2HJunn/g5bz8685w HVfYPOUxovJZsARRUYeoDM1rGGal+RwcOXxdWp9f+HxgGLr3LC2b9j210pkdJZngbJSr Kh1KOKIlEuCtds5Wv5qVVrmxDUL0P380pb97eg3xXKu/X7Vz/eJ/26t/F/C2xGrk1JXm WZa1n07A/LfvutNOvKpDnxdkHxvCbGdZOueaSZ+LKSY+QDql9BE39qvt5ClYzgbA3CVc jwCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Rw30GbvtcIm1GUQdzvA/7DYGLWz5chvWddEClUCty98=; b=BJHtN6WdIPMiO3xLVFWMpg09GIkQLWpGg0GEP8hGdZVYVKiMKst1rq1pLUSo5iNObJ DT0eV/Ng9K9gAuaEEKj3eRvWYMM7PM5ZBVKywKoxlU5dSlJGjYWSSYvXwHpWStLpEO8I s+59tGB2J7vtDl57fcw8/28rEFchlToKlbnAfynFkvl1er0jU78tRrLTWpIxjI5rH6r6 xd0I2cgWmWXCB3FpaPWecNUFIMk2Q3QHkqcyTHOi3F0++/fPLmxRpwdkPI8XPEKYL8hH abWR8b/OacZPbYCyVCY4ex6VBq/VkGacJSN6vRv2Tb8nCLiw3jMxupbmJidkrcM6k3q1 7wbQ== X-Gm-Message-State: APt69E0Dhb4BpESF38BbCIaMwFNzqh7+GvTTEbzWXEIywYdL5AyirS9K fXRELQh9GD4DdbsyPppUn/1Hz6HBnhDCbywbLJM= X-Received: by 2002:ab0:1446:: with SMTP id c6-v6mr813050uae.12.1530700564714; Wed, 04 Jul 2018 03:36:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 03:36:04 -0700 (PDT) In-Reply-To: <20180704102240.2C00942D43@mail.steuer-voss.de> References: <20180704102240.2C00942D43@mail.steuer-voss.de> From: Andy Shevchenko Date: Wed, 4 Jul 2018 13:36:04 +0300 Message-ID: Subject: Re: [PATCH] ACPI: bus.c: Let acpi_device_get_match_data() return DT compatibility data To: Nikolaus Voss Cc: Sudeep Holla , Ray Jui , Vladimir Olovyannikov , Vikram Prakash , Scott Branden , ACPI Devel Maling List , Linux Kernel Mailing List , Srinath Mannam , nv@vosn.de Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 3, 2018 at 9:09 AM, Nikolaus Voss wrote: > When using ACPI with ACPI_DT_NAMESPACE_HID/ PRP0001 HID and referring to > of_device_id table "compatible" strings in DSD, a pointer to the > corresponding DT table entry should be returned instead of a null > pointer. An acpi_device_id match still takes precedence. AFAIU it's just bounce for new comers to the discussion. The patch is in its original form and didn't incorporate any review comments so far. > Signed-off-by: Nikolaus Voss > --- > drivers/acpi/bus.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c > index 84b4a62018eb..c2deffea842e 100644 > --- a/drivers/acpi/bus.c > +++ b/drivers/acpi/bus.c > @@ -832,13 +832,18 @@ EXPORT_SYMBOL_GPL(acpi_match_device); > > const void *acpi_device_get_match_data(const struct device *dev) > { > - const struct acpi_device_id *match; > + const struct acpi_device_id *acpi_id = NULL; > + const struct of_device_id *of_id = NULL; > + const struct device_driver *drv = dev->driver; > > - match = acpi_match_device(dev->driver->acpi_match_table, dev); > - if (!match) > + __acpi_match_device(acpi_companion_match(dev), drv->acpi_match_table, > + drv->of_match_table, &acpi_id, &of_id); > + if (acpi_id) > + return (const void*)acpi_id->driver_data; > + else if (of_id) > + return (const void*)of_id->data; > + else > return NULL; > - > - return (const void *)match->driver_data; > } > EXPORT_SYMBOL_GPL(acpi_device_get_match_data); > > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko