From: Timur Tabi <timur@codeaurora.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: andy.gross@linaro.org, david.brown@linaro.org,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] pinctrl: qcom: qdf2xxx: add support for new ACPI HID QCOM8002
Date: Fri, 14 Jul 2017 13:30:50 -0500 [thread overview]
Message-ID: <99cc9d6e-da81-82b5-8402-0a471a6c9fb2@codeaurora.org> (raw)
In-Reply-To: <20170714172121.GN20973@minitux>
On 07/14/2017 12:21 PM, Bjorn Andersson wrote:
>> +enum {
>> + QDF2XXX_V1,
>> + QDF2XXX_V2,
>> +};
>> +
>> +static const struct acpi_device_id qdf2xxx_acpi_ids[] = {
>> + {"QCOM8001", QDF2XXX_V1},
>> + {"QCOM8002", QDF2XXX_V2},
>> + {},
>> +};
>> +MODULE_DEVICE_TABLE(acpi, qdf2xxx_acpi_ids);
>
> NB. too bad there doesn't seem to be an equivalent of
> of_device_get_match_data().
There's acpi_match_device(), which I use.
>
>> +
>> static int qdf2xxx_pinctrl_probe(struct platform_device *pdev)
>> {
>> + const struct acpi_device_id *id =
>> + acpi_match_device(qdf2xxx_acpi_ids, &pdev->dev);
>> + struct device *dev = &pdev->dev;
>> struct pinctrl_pin_desc *pins;
>> struct msm_pingroup *groups;
>> char (*names)[NAME_SIZE];
>> unsigned int i;
>
> The result of the patch looks fine, but unfortunately there's some noise
> in the patch due to the transition from &pdev->dev to dev and num_gpios
> to max_gpios.
I did that to shrink the line lengths. I can put it back if you want.
>
>> - u32 num_gpios;
>> + unsigned int num_gpios; /* The number of GPIOs we support */
>> + u32 max_gpios; /* The highest number GPIO that exists */
>
> Could you please keep the "num_gpios" naming and name the new variable
> "avail_gpios" or something similar.
Sure.
>
>> + u16 *gpios; /* An array of supported GPIOs */
>> int ret;
>
>>
>> - /* Query the number of GPIOs from ACPI */
>> - ret = device_property_read_u32(&pdev->dev, "num-gpios", &num_gpios);
>> + /* The total number of GPIOs that exist */
>> + ret = device_property_read_u32(dev, "num-gpios", &max_gpios);
>> if (ret < 0) {
>> - dev_warn(&pdev->dev, "missing num-gpios property\n");
>> + dev_err(dev, "missing or invalid 'num-gpios' property\n");
>
> While this makes sense it's not entirely related to this patch. My
> suggestion is that you prepend a patch transitioning &pdev->dev to dev
> and change these to dev_err in the same.
I'd rather put pdev->dev back.
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2017-07-14 18:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-13 21:52 [PATCH 0/2] pinctrl: qcom: add support for sparse GPIOs Timur Tabi
2017-07-13 21:52 ` [PATCH 1/2] pinctrl: qcom: disable GPIO groups with no pins Timur Tabi
2017-07-14 16:44 ` Bjorn Andersson
2017-07-14 17:01 ` Timur Tabi
2017-07-14 17:35 ` Bjorn Andersson
2017-07-14 17:11 ` Stephen Boyd
2017-07-14 17:17 ` Timur Tabi
2017-07-14 17:23 ` Bjorn Andersson
2017-07-14 21:43 ` Timur Tabi
2017-07-14 21:46 ` Stephen Boyd
2017-07-14 22:01 ` Timur Tabi
2017-07-14 22:04 ` Stephen Boyd
2017-07-13 21:52 ` [PATCH 2/2] pinctrl: qcom: qdf2xxx: add support for new ACPI HID QCOM8002 Timur Tabi
2017-07-14 17:21 ` Bjorn Andersson
2017-07-14 18:30 ` Timur Tabi [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-03-23 23:44 [PATCH 1/2] pinctrl: qcom: remove static globals to allow multiple TLMMs Timur Tabi
2018-03-23 23:45 ` [PATCH 2/2] pinctrl: qcom: qdf2xxx: add support for new ACPI HID QCOM8002 Timur Tabi
2018-04-03 4:07 ` Bjorn Andersson
2018-04-03 12:03 ` Timur Tabi
2018-04-07 12:33 ` Stephen Boyd
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=99cc9d6e-da81-82b5-8402-0a471a6c9fb2@codeaurora.org \
--to=timur@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=david.brown@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).