Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp337407imm; Tue, 3 Jul 2018 20:38:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcmC8yP45bwLANXViifMYPX6MnwBW4CnGS18G9RTQJPO7arSpzMSmqiVhp3cXhYmUn93ddp X-Received: by 2002:a62:4494:: with SMTP id m20-v6mr376163pfi.205.1530675507001; Tue, 03 Jul 2018 20:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530675506; cv=none; d=google.com; s=arc-20160816; b=Gj3NmH5uADmHQhE5jol9Nnj/AJ2s9k+ugPEcjgTJrUln7dH45bo3oclLQYoBMI8RDO j/v4hSXB49DxtuKnNd+MaB6QiDEo30oaLssN44773P+CyK3fAs0HIcMDoEh04HfcUpWb dOL9Vcoxwb8Z19sh9N1YRUnddQ3RghRktM849WZmrs0Y+f8zml+XclHh+R5xfB6+3kD5 BmgamDG8oadEUCJXpk1gF5gvzxH/jUwKreip3FgcH8596MaewLq9JiX8E46u/LZSHSVQ R5rMBYedU6SpW2rwK4+V1HCHdHw0PdgoZjzT2IwHt+NMumyY6EHCxNY4A6qXK4gnp4yd OijA== 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=UzZmaGipAT4qB3UKnL65Gf05TtfyJBxBOBkqAU7A9xA=; b=OVF4FPnM2gepSNAgSMbNgiIe7kY2ardxnIrI2/UINcnAyoLEObQzgvNEmhE4MEEPoD dFkTlXryrRzUxRfhvU/sshYUJ5OFMLZxgt9nOuAr0jK8tysNRVxf/algAPuOQirgxika YETEgjbFzG6FQ2B93DZUObh+2ZxVDlZa5rujgmtwpGXTeGTOAW6dJHszblI5UxIFlyyc lB4laOqgSjYoHgDuSQAVUTt9Q2+rQPCyfqSxwnAwBxQavc4LKgV2d+6HBcL0u0wwRO5Y MDyc8iqZqc2LQ/DZqalGK06NCETyFARtdnvYdwvoUzLXtdO/UEFyJP92J/ud0oRkU5np njtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=LYFuPFkD; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v41-v6si2574764plg.451.2018.07.03.20.38.10; Tue, 03 Jul 2018 20:38:26 -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=@broadcom.com header.s=google header.b=LYFuPFkD; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932701AbeGDDha (ORCPT + 99 others); Tue, 3 Jul 2018 23:37:30 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:34550 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196AbeGDDh0 (ORCPT ); Tue, 3 Jul 2018 23:37:26 -0400 Received: by mail-oi0-f67.google.com with SMTP id 13-v6so8053103ois.1 for ; Tue, 03 Jul 2018 20:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UzZmaGipAT4qB3UKnL65Gf05TtfyJBxBOBkqAU7A9xA=; b=LYFuPFkDLNlGjT6ar3wNGuy/Rl0XVRNbDCAe0cD5NGmekhMNbaRzGZ+DI5UAzZ2i4J Vg3ZK78aPQFVTTEEwAYrMLsg2SkgkfgbSV2a0yQX3komHVV9wfuz7zvlddt1sXSGW4Sa nkOVceAZwqswJjwo1cjHW0a33aSRWyBRoM8+g= 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=UzZmaGipAT4qB3UKnL65Gf05TtfyJBxBOBkqAU7A9xA=; b=gtt/R071PLWOSI5Q4vYnWm2+X8F1xqnipzcdYtWQe0Ros2iOAvyEOJq32MPzWnJUyR rpLn2OJ+N7b1Y+WmhUaiGfDUL817E7qolAv2P6j0TkYZUPe0bu+dPnbWbXhEq1vpKYfe P6JkOaiiCZ9gwOup5sihXfw3wDnlZSe1Oqu+dgUYEjqzm7t+pQaaXsXIInmvhca95kqP oRrEumvZ6WGx5cWp8JhlD04y8i8xWDY1+AzrDgg1OK5ntD2JmjWWLXmsnyh0XhOPMTpo v6xkQ/fczzU1rIpZfqM6+pSQhQ4WITWXrUzKlKuJJ6ItjnFEOplSrQ1NjqNoPxvL3M4u Eysw== X-Gm-Message-State: APt69E34s2lSlaQg1YMbAIfF6JyTJQaecXZjBp4hSQl98UYd+HYIaje1 WZckZeSt2+Le1haOYum0Nf3IBzMhVkDm/RMpy+9Nfg== X-Received: by 2002:aca:37c2:: with SMTP id e185-v6mr343870oia.326.1530675446277; Tue, 03 Jul 2018 20:37:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:51d2:0:0:0:0:0 with HTTP; Tue, 3 Jul 2018 20:37:25 -0700 (PDT) In-Reply-To: References: <1530609760-8919-1-git-send-email-srinath.mannam@broadcom.com> From: Srinath Mannam Date: Wed, 4 Jul 2018 09:07:25 +0530 Message-ID: Subject: Re: [RFC PATCH] ACPI: bus: match of_device_id using acpi device To: Andy Shevchenko , Sudeep Holla Cc: "Rafael J. Wysocki" , Len Brown , Ray Jui , Vladimir Olovyannikov , Vikram Prakash , Scott Branden , ACPI Devel Maling List , Linux Kernel Mailing List 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 Hi Sudeep, Andy, Yes, This patch is to get of_device_id and then fetch data pointer. To add ACPI support in multiple drivers which are device-tree based and has list of of_device_ids, by using this function very minimal changes and can avoid acpi_device_id list in the driver. I will send driver changes where this function used to add ACPI support in following patches. Below are the changes added to add ACPI support in sdhci iproc driver using this function. diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c index db40218..f1ecac97 100644 --- a/drivers/mmc/host/sdhci-iproc.c +++ b/drivers/mmc/host/sdhci-iproc.c @@ -15,6 +15,7 @@ * iProc SDHCI platform driver */ +#include #include #include #include @@ -267,8 +268,13 @@ static int sdhci_iproc_probe(struct platform_device *pdev) int ret; match = of_match_device(sdhci_iproc_of_match, &pdev->dev); - if (!match) - return -EINVAL; + if (!match) { + match = acpi_match_of_device_id(sdhci_iproc_of_match, + &pdev->dev); + if (!match) + return -EINVAL; + } + iproc_data = match->data; host = sdhci_pltfm_init(pdev, iproc_data->pdata, sizeof(*iproc_host)); Regards, Srinath. On Tue, Jul 3, 2018 at 11:11 PM, Andy Shevchenko wrote: > On Tue, Jul 3, 2018 at 12:22 PM, Srinath Mannam > wrote: >> This patch provides a function, to get of_device_id after >> matching with ACPI device _DSD object compatible property >> in the case driver does not contain acpi_device_id list >> and driver probe called for ACPI device ID PRP0001 with >> compatible property match with of_device_id compatible. > > I don't see any usefulness of this function. Care to provide a real use case? > > -- > With Best Regards, > Andy Shevchenko