From: Stephen Boyd <sboyd@codeaurora.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-input@vger.kernel.org,
Bjorn Andersson <bjorn.andersson@sonymobile.com>
Subject: Re: [PATCH v2] Input: pmic8xxx-pwrkey - Support shutdown
Date: Mon, 13 Jul 2015 17:59:10 -0700 [thread overview]
Message-ID: <55A45EDE.6050603@codeaurora.org> (raw)
In-Reply-To: <55A45EAA.9040001@codeaurora.org>
On 07/13/2015 05:58 PM, Stephen Boyd wrote:
> On 07/13/2015 05:46 PM, Dmitry Torokhov wrote:
>> On Mon, Jul 13, 2015 at 05:34:57PM -0700, Stephen Boyd wrote:
>>> On 07/13/2015 05:25 PM, Dmitry Torokhov wrote:
>>>>> +
>>>>> +static const struct of_device_id pm8xxx_pwr_key_id_table[] = {
>>>>> + { .compatible = "qcom,pm8058-pwrkey", .data =
>>>>> &pm8058_pwrkey_shutdown },
>>>>> + { .compatible = "qcom,pm8921-pwrkey", .data =
>>>>> &pm8921_pwrkey_shutdown },
>>>>> + { }
>>>>> +};
>>>>> +MODULE_DEVICE_TABLE(of, pm8xxx_pwr_key_id_table);
>>>>> +
>>>> Can we please keep IDs and device table where it was, close to the
>>>> driver definition?
>>> That would require forward declaring the array here. Is that
>>> desired? I moved it so that I could use it in the probe function.
>> Ah, yes, OF data is not passed into probe() :(... But we can always do:
>>
>> match = of_match_device(pdev->dev.driver->of_match_table,
>> &pdev->dev);
>>
>> Maybe we could have a helper for this like:
>>
>> const struct of_device_id *of_get_current_match(struct device *dev)
>> {
>> return dev->drv ?
>> of_match_device(dev->driver->of_match_table, dev) :
>> NULL;
>> }
>
> Nice. I'll update and Cc the OF maintainers.
>
Actually, this already exists I just didn't know. See
of_device_get_match_data().
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] Input: pmic8xxx-pwrkey - Support shutdown
Date: Mon, 13 Jul 2015 17:59:10 -0700 [thread overview]
Message-ID: <55A45EDE.6050603@codeaurora.org> (raw)
In-Reply-To: <55A45EAA.9040001@codeaurora.org>
On 07/13/2015 05:58 PM, Stephen Boyd wrote:
> On 07/13/2015 05:46 PM, Dmitry Torokhov wrote:
>> On Mon, Jul 13, 2015 at 05:34:57PM -0700, Stephen Boyd wrote:
>>> On 07/13/2015 05:25 PM, Dmitry Torokhov wrote:
>>>>> +
>>>>> +static const struct of_device_id pm8xxx_pwr_key_id_table[] = {
>>>>> + { .compatible = "qcom,pm8058-pwrkey", .data =
>>>>> &pm8058_pwrkey_shutdown },
>>>>> + { .compatible = "qcom,pm8921-pwrkey", .data =
>>>>> &pm8921_pwrkey_shutdown },
>>>>> + { }
>>>>> +};
>>>>> +MODULE_DEVICE_TABLE(of, pm8xxx_pwr_key_id_table);
>>>>> +
>>>> Can we please keep IDs and device table where it was, close to the
>>>> driver definition?
>>> That would require forward declaring the array here. Is that
>>> desired? I moved it so that I could use it in the probe function.
>> Ah, yes, OF data is not passed into probe() :(... But we can always do:
>>
>> match = of_match_device(pdev->dev.driver->of_match_table,
>> &pdev->dev);
>>
>> Maybe we could have a helper for this like:
>>
>> const struct of_device_id *of_get_current_match(struct device *dev)
>> {
>> return dev->drv ?
>> of_match_device(dev->driver->of_match_table, dev) :
>> NULL;
>> }
>
> Nice. I'll update and Cc the OF maintainers.
>
Actually, this already exists I just didn't know. See
of_device_get_match_data().
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-07-14 0:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 23:30 [PATCH v2] Input: pmic8xxx-pwrkey - Support shutdown Stephen Boyd
2015-07-13 23:30 ` Stephen Boyd
2015-07-13 23:37 ` Bjorn Andersson
2015-07-13 23:37 ` Bjorn Andersson
2015-07-13 23:37 ` Bjorn Andersson
2015-07-14 0:25 ` Dmitry Torokhov
2015-07-14 0:25 ` Dmitry Torokhov
2015-07-14 0:34 ` Stephen Boyd
2015-07-14 0:34 ` Stephen Boyd
2015-07-14 0:46 ` Dmitry Torokhov
2015-07-14 0:46 ` Dmitry Torokhov
2015-07-14 0:58 ` Stephen Boyd
2015-07-14 0:58 ` Stephen Boyd
2015-07-14 0:59 ` Stephen Boyd [this message]
2015-07-14 0:59 ` 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=55A45EDE.6050603@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=bjorn.andersson@sonymobile.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.