From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753108AbdKJORV (ORCPT ); Fri, 10 Nov 2017 09:17:21 -0500 Received: from foss.arm.com ([217.140.101.70]:59954 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbdKJORT (ORCPT ); Fri, 10 Nov 2017 09:17:19 -0500 Subject: Re: [PATCH V2 2/3] dmaengine: qcom_hidma: add support for the new revision To: Sinan Kaya , dmaengine@vger.kernel.org, Timur Tabi Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "linux-acpi@vger.kernel.org" , "Rafael J. Wysocki" References: <1510158582-5343-1-git-send-email-okaya@codeaurora.org> <1510158582-5343-2-git-send-email-okaya@codeaurora.org> <3ca59a37-e8f8-a2cf-fa3a-f4ee6d544dcd@codeaurora.org> From: Robin Murphy Message-ID: Date: Fri, 10 Nov 2017 14:17:16 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <3ca59a37-e8f8-a2cf-fa3a-f4ee6d544dcd@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/11/17 14:03, Sinan Kaya wrote: > +linux-acpi, +Rafael for context > > On 11/8/2017 12:51 PM, Robin Murphy wrote: >> Apologies if I wasn't very clear, but what I meant to imply by dropping the of_device_get_match_data() hint was to follow one of the common patterns where you either just have some version token: >> >>     enum foo_ver { >>         FOO_V1, >>         ... >>     } >> >>     struct acpi_device_id foo_acpi_ids[] = { >>         { "_FOO0001", FOO_V1 }, >>         ... >>     } >> >>     struct of_device_id foo_of_match[] = { >>         { .compatible = "foo,v1", .data = (void *)FOO_V1 }, >>         ... >>     } >> >>     int foo_probe(struct device *dev) { >>         ... >>         foodev->version = (enum foo_ver) >>                 of_device_get_match_data(&dev->of_node) >>         ... >>     } >> >>     int foo_reset(struct foodev *foodev) { >>         if (foodev->version == FOO_V1) >>             writel(0, foodev->base + 0x20); >>         else >>             writel(0, foodev->base + 0x30); >>     } > > I did post v3 with this approach. However, I could not really find a ACPI function that > returns the driver data very similar to of_device_get_match_data(). The only thing > that is closer is acpi_match_device(). Yeah, I left the "follow the status quo and open-code it" part out of the above example for brevity ;) Probably 95% of the calls to acpi_match_device() are only doing so to retrieve the driver_data, so the helper could provide scope for further cleanup if anyone wants, too. > I introduced this new function as part of the v3 series. > > Let me know if I'm missing something. v3 looks good, thanks for persevering - I'll leave the rest up to Vinod and Rafael. Cheers, Robin.