mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Sinan Kaya <okaya@codeaurora.org>,
	dmaengine@vger.kernel.org, Timur Tabi <timur@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH V2 2/3] dmaengine: qcom_hidma: add support for the new revision
Date: Fri, 10 Nov 2017 14:17:16 +0000	[thread overview]
Message-ID: <e51a6e84-5761-a81d-9105-49e9ae047f2b@arm.com> (raw)
In-Reply-To: <3ca59a37-e8f8-a2cf-fa3a-f4ee6d544dcd@codeaurora.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.

  parent reply	other threads:[~2017-11-10 14:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 16:29 [PATCH V2 1/3] Documentation: DT: qcom_hidma: bump HW revision for the bugfixed HW Sinan Kaya
2017-11-08 16:29 ` [PATCH V2 2/3] dmaengine: qcom_hidma: add support for the new revision Sinan Kaya
2017-11-08 16:49   ` Timur Tabi
2017-11-08 16:58     ` Sinan Kaya
2017-11-08 17:12       ` Timur Tabi
2017-11-08 17:37         ` Sinan Kaya
2017-11-08 17:51           ` Timur Tabi
2017-11-08 17:51   ` Robin Murphy
2017-11-10 14:03     ` Sinan Kaya
2017-11-10 14:14       ` Timur Tabi
2017-11-10 14:17       ` Robin Murphy [this message]
2017-11-08 16:29 ` [PATCH V2 3/3] dmaengine: qcom_hidma: add identity register support Sinan Kaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e51a6e84-5761-a81d-9105-49e9ae047f2b@arm.com \
    --to=robin.murphy@arm.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okaya@codeaurora.org \
    --cc=rjw@rjwysocki.net \
    --cc=timur@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®